Jump to content

[SOLVED] Calculating problem


Panjabel

Recommended Posts

<?php
$ok = 60;
if (($ok>30) || ($ok<=50)){
print "30-50";
}
else
{
print "60-over";
}
?>

doesn't work too,

$ok = 60;

so i want it to print out "60-over" but it print out  "30-50"

what's wrong ?

 

Ohh I see. You're using || which means OR. You need to use && (and):

 

<?php
$ok = 60;
if (($ok>=30) && ($ok<=50)){
print "30-50";
}
else
{
print "60-over";
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.