Issue with php variables inline with HTML Code

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

Post Reply
chrisbowles
Forum Newbie
Posts: 1
Joined: Wed Oct 14, 2009 6:07 pm

Issue with php variables inline with HTML Code

Post by chrisbowles »

My Code is...

Code: Select all

 
<?php
 $b = 1;
 echo $save[$b][name];
?>
 
My Result is...

Code: Select all

 
Displays the correct value
 
If I try to use the same variable with HTML code
My Code is...

Code: Select all

 
<?php
 $b = 1;
 echo"<table><tr><td>$save[$b][name]</td></tr></table>";
?>
 

Code: Select all

 
Displays array[name]
 
I can't for the life of me figure out why it displays two different ways.
Post Reply