1.

Solve : Question on PHP?

Answer»

For my summer internship i was asked to find out what the FOLLOWING lines of code in php will do:
$var="hello";
$$var="world";
ECHO $hello;
$var();


ANYONE KNOW?Do some studying at http://www.w3schools.com/php/default.asp. why not try it out for yourself?well i believe that the first one inputs the string hello into the variable $var, and the third statement prints or outputs the variable $hello which has no value cause it hasnt been given one yet. I've NEVER seen a double $ sign and I dont exactly understand what is going on with the $var();Have you tested the code snippet yet? Sometimes that is the best way to learn.



Discussion

No Comment Found