Variable problem, how to get 56789?


$a ="12345";

$ok =<<<HTML

echo $a.'<hr/>';
$a = "56789";
//Why not 56789???
echo $ok.'<hr/>';


Started by Rose at November 02, 2016 - 10:31 PM

Why 56789? What do you think?

Posted by Elton at November 08, 2016 - 11:21 PM

$OK =... Means has been assigned.
If you want to see $ok as a template, can pass a value
You use the function parameter passing, or, as sprintf format, then assign

Posted by Moses at November 19, 2016 - 12:04 AM

Because you just put the $a value is assigned to $ok. So $ok is not a $a reference, so the changes in $a will not affect the value of $ok

Posted by Rock at November 27, 2016 - 12:07 AM