PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
jasondavis
Forum Commoner
Posts: 60 Joined: Sat Feb 04, 2006 5:35 pm
Post
by jasondavis » Mon Jul 03, 2006 6:16 am
Code: Select all
$random_array = array('w4w $friend_count friends here', 'click me', 'I can get you tons of friends...I have over $friend_countk');
How can I get the variables friend_count to work in the array like that, I dont have proper synthax
Oren
DevNet Resident
Posts: 1640 Joined: Fri Apr 07, 2006 5:13 am
Location: Israel
Post
by Oren » Mon Jul 03, 2006 6:34 am
Replace the
' (single quote) with
" (double quote)
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Mon Jul 03, 2006 6:51 am
...or like this
Code: Select all
$random_array = array('w4w '.$friend_count.' friends here', 'click me', 'I can get you tons of friends...I have over '.$friend_countk.'');
Oren
DevNet Resident
Posts: 1640 Joined: Fri Apr 07, 2006 5:13 am
Location: Israel
Post
by Oren » Mon Jul 03, 2006 9:37 am
Yes, both are fine