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
bugthefixer
Forum Contributor
Posts: 118 Joined: Mon Mar 22, 2004 2:35 am
Post
by bugthefixer » Wed Apr 21, 2004 4:30 pm
when i write code like this
Code: Select all
<?php
echo "variable is $_session["stname"]";
?>
i get error saying expecting number string or something like this..
in other words it doesnt recognise escaping characters..
wat cud be the prob
JAM
DevNet Resident
Posts: 2101 Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:
Post
by JAM » Wed Apr 21, 2004 4:32 pm
I prefer:
Code: Select all
<?php
echo 'variable is ' . $_SESSION['stname'];
// or...
echo "variable is {$_SESSION['stname']}";
?>
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Thu Apr 22, 2004 1:51 am
yeah, just use single quotes are concatenate the two bits