could u explain why for these fun lines?
Posted: Thu Jul 28, 2005 6:42 am
first all, do not simply give me a link, i did read many docs from google but i can not find answer.
explain first, then links - thanks.
followings are code in a php file but out of <?php?> tag.
===============================================
<?php $var0="hello, boys"; ?>
<form>
<input type="text" value=<?php print("'$var0'"); ?> style="width:200;">
<br>
<input type="text" value=<?php print("$var0"); ?> style="width:200;">
<br>
<input type="text" value=<?php print($var0); ?> style="width:200;">
</form>
<?php print("'$var0'"); ?>
<br>
<?php print("$var0"); ?>
<br>
<?php print($var0); ?>
<br>
===============================================
output:
-------------- first 3 lines (in inputs) are:
hello, boys
hello,
hello,
-------------- last 3 lines (not in inputs) are:
'hello, boys'
hello, boys
hello, boys
if you compare a line (in input) with respective line (not in input), you see they are different.
what does first 3 lines mean?
(last 3 lines are easy to be understood)
why?
by the way: is print() the same as echo()?
explain first, then links - thanks.
followings are code in a php file but out of <?php?> tag.
===============================================
<?php $var0="hello, boys"; ?>
<form>
<input type="text" value=<?php print("'$var0'"); ?> style="width:200;">
<br>
<input type="text" value=<?php print("$var0"); ?> style="width:200;">
<br>
<input type="text" value=<?php print($var0); ?> style="width:200;">
</form>
<?php print("'$var0'"); ?>
<br>
<?php print("$var0"); ?>
<br>
<?php print($var0); ?>
<br>
===============================================
output:
-------------- first 3 lines (in inputs) are:
hello, boys
hello,
hello,
-------------- last 3 lines (not in inputs) are:
'hello, boys'
hello, boys
hello, boys
if you compare a line (in input) with respective line (not in input), you see they are different.
what does first 3 lines mean?
(last 3 lines are easy to be understood)
why?
by the way: is print() the same as echo()?