| Author |
if/while statements
|
|
|
| Hi,
I've been experimenting with different statements but can't seem to get them
work.
My if statement:
<?
$myage = 35;
if $myage -> 40)
{print "over 40";}
else
{print "under 40";}
?>
The only statement that I can get working is; if $myname is == "Tom" then
echo "It is equal!"
Could anyone please let me know why this isn't working?
Thanks for your help
Tom
| |
| Geoff Berrow 2005-11-25, 6:56 pm |
| Message-ID: <4387a092$0$25857$afc38c87@news.optusnet.com.au> from Tom
contained the following:
>Could anyone please let me know why this isn't working?
Have you thought of looking up comparison operators in the manual?
http://uk.php.net/operators.comparison
--
Geoff Berrow 0110001001101100010000000110
0011011010110110010001101111011001110010
11
1001100011011011110010111001110101011010
11
| |
|
|
| Dummy Newgroup name 2005-11-26, 6:56 pm |
| In article <4387a092$0$25857$afc38c87@news.optusnet.com.au>, Tom wrote:
> I've been experimenting with different statements but can't seem to get them
> work.
If you wrote here *exactly* what you're trying to run then you're missing a
left bracket "(", which looks like the only thing wrong with this.
Mark
|
|
|
|