need help....combine strings

  • Scott123
  • Newbie
  • Newbie
  • Scott123
  • Posts: 10

Post 3+ Months Ago

Code: [ Select ]
#This works
$get_content = file_get_contents("")
#This does not work
$get_content = file_get_contents($nexturl);
  2. $authcode="12345"
  3. $nexturl="\"".$authcode."\"";
  5. #This works
  6. $get_content = file_get_contents("")
  8. #This does not work
  9. $get_content = file_get_contents($nexturl);



:cry: Thanks.
  • joebert
  • Genius
  • Genius
  • User avatar
  • Posts: 13511
  • Loc: Florida

Post 3+ Months Ago

Arguments only need quotes around them when they're being passed as string literals. When you pass a variable name instead of a string literal, for example passing $nexturl instead of "http://...", the contents of that variable do not need to include quotes.

So where you're including escaped double quotes like \", the function you're passing the argument to considers that first quote the first character of the argument instead of the "h" from http:// like it wants.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 46 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.