dezkit Posted April 21, 2008 Share Posted April 21, 2008 Whats the difference between these echo's? <?php $name = "max"; echo "Hello $name"; ?> <?php $name = "max"; echo "Hello " . $name; ?> Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 Nothing, because you used double quotes. In double quotes (""), variables are parsed. In single quotes (''), you need to concatenate it like you did in the second echo. =) Quote Link to comment Share on other sites More sharing options...
redarrow Posted April 21, 2008 Share Posted April 21, 2008 little example <?php $name="redarrow \t"; $member="php freaks"; echo "php phased: my name is $name << this varable was phased using double quotes<br><br>"; echo 'php litral: my name is $name << this varable was echoed becouse i used the single quotes<br><br>'; $x=$name.$member; echo "php phased catarnation: my name is $x << this varable was phased and caternated using double quotes<br><br>"; ?> Quote Link to comment Share on other sites More sharing options...
atravotum Posted April 21, 2008 Share Posted April 21, 2008 I was actually wondering that myself Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.