Jump to content

echo syntax problem. please help.


loshyt

Recommended Posts

ok im building facebook app and im just back to php after months not touched it.

 

this is the code:

$image = $facebook->api_client->photos_get(null,null, echo $uid);
print_r ($image);
echo "<BR>";
echo $image[0]["src"];

 

the problem is that echo $uid

i tried every variation and it does not work!

 

i maybe forget something that i should have done?

 

the $uid containing user id numbers so what i did wrong and if im not wrong i wanted the numbers($uid) Wrapped in quotation marks

 

so i tried: echo ." $uid ".

and alot of other

 

plz help tnx :P

Link to comment
https://forums.phpfreaks.com/topic/226993-echo-syntax-problem-please-help/
Share on other sites

You can't echo in a function argument list.  Echo literally means "echo this to the screen", so you can see how that won't make sense.  If you need quotes around the variable, simply do:

 

$uid = '"' . $uid . '"';

(that's a single quote, followed by a double quote, followed by another single quote)

 

That said, are you sure you need the value of $uid to be wrapped in quotes?

You can't echo in a function argument list.  Echo literally means "echo this to the screen", so you can see how that won't make sense.  If you need quotes around the variable, simply do:

 

$uid = '"' . $uid . '"';

(that's a single quote, followed by a double quote, followed by another single quote)

 

That said, are you sure you need the value of $uid to be wrapped in quotes?

tnx

silly me!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.