Jump to content

php Challenged


george

Recommended Posts

Where $key and $item are valid text variables containing valid values, Why does this work?

echo "$key. $item<br />\n";

I thought the correct code would be

echo $key . $item . "<br />\n";

Is php responding to the $ to render the value of the variable even when it is within quotes? I thought that by being in quotes, it would render the literal value of what is quoted, and not the variable content.

Link to comment
Share on other sites

why it works well, just becouse it is the right way to use it, you chould use :

echo"$key . $item .\"<br>\n\""; //but why do you have the \n actually? <br> works just fine dont it?

Dont actually understand what the whole challenge thing was about :)..-Kristian_C

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...