edpatterson
IS-IT--Management
- Feb 24, 2005
- 186
No, I am not looking to start a holy war, I am looking for expalinations in converting perl syntax to php.
I tried this code:[tt]
<?php
$var1 = 8;
$var2 = 1;
print "$var1 < $var2 -- ".$var1 < $var2."<br />";
?>[/tt]
and received a blank page. Changing it to:
<?php[tt]
$var1 = 8;
$var2 = 1;
print "$var1 < $var2 -- ";
print $var1 < $var2;
?>[/tt]
returns
8 < 1 --
I was expecting:
8 < 1 -- True (or 1 or any non zero number)
I thought the . was the concatenation operator and I assumed the boolean test would return it's value.
Thanks for any pointers.
Ed
I tried this code:[tt]
<?php
$var1 = 8;
$var2 = 1;
print "$var1 < $var2 -- ".$var1 < $var2."<br />";
?>[/tt]
and received a blank page. Changing it to:
<?php[tt]
$var1 = 8;
$var2 = 1;
print "$var1 < $var2 -- ";
print $var1 < $var2;
?>[/tt]
returns
8 < 1 --
I was expecting:
8 < 1 -- True (or 1 or any non zero number)
I thought the . was the concatenation operator and I assumed the boolean test would return it's value.
Thanks for any pointers.
Ed