Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8452325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:28:14+00:00 2026-06-10T11:28:14+00:00

So in PHP I am trying to open a URL using; $raw = file_get_contents($inlink);

  • 0

So in PHP I am trying to open a URL using;

$raw = file_get_contents($inlink);

and then I am working on the results. $inlin come from a $_GET variable. This works for most URLs but I have an issue when the URL includes the TM (™) symbol as I get a 404 error.

The URL in question is http://www.boots.com/en/Soap-Glory-Flake-Away-™-Body-Scrub-300ml_27894/

So it seems like an encoding issue. So I have tried urlencode, but this doesn’t help. I have also tried copy and past from the address bar in firefox, so that I enter

http://www.boots.com/en/Soap-Glory-Flake-Away-%E2%84%A2-Body-Scrub-300ml_27894/

instead, but this also does not help.

Through debugging and echoing to the screen then I end up with either

http://www.boots.com/en/Soap-Glory-Flake-Away-â„¢-Body-Scrub-300ml_27894/

or

http%3A%2F%2Fwww.boots.com%2Fen%2FSoap-Glory-Flake-Away-%E2%84%A2-Body-Scrub-300ml_27894%2F

being submitted, neither of which works.

Strange thing, is that if I hard code the link in the program then it works!

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:28:16+00:00Added an answer on June 10, 2026 at 11:28 am

    You need to utf8_encode the URL (I assume it comes by in ISO-8859-1(5)/Latin1)

    Also, I assume you are utf8_decoding and validating the URL before you run the file_get_contents() – you wouldn’t want a user to make your system request an arbitrary URL from anywhere on the Internet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using php I am trying to get some data from a .csv file which
I am trying to take data from an array using Facebook Open Graph. I
I am trying to create a table within PHP code in order to open
Working with PHP Xpath trying to quickly pull certain links within a html page.
Im a newbie ih php.Im trying to show drop down list values from database
I'm using MongoDB and PHP and trying to do a $in based on a
Using PHP I'm trying to download/save the following image: http://www.bobshop.nl/catalog/product_image.php?size=detail&id=42428 When you load this
Im trying to decode a json string returned from flickr within my PHP code.
I'm trying to open my chat script in a popup window using window.open function.
im trying to pass an array of data to a PHP script using Jquery's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.