Jump to content

if bigger than 100


dachshund

Recommended Posts

$var = ($rows['views'] > 100)?true:false;

BAM hehe.

If the statement in the brackets is true return true, otherwise false.

Avoid using numbers at the start of variables and you're fine. Hope it helps.

this might help to understand this syntax.

Also when saying (greater than '100') don't use the quotes, treat it as a number.

echo "Hey, ".(($rows['views']>100)?"It's greater":"It's not greater")." and bye.";

 

Link to comment
https://forums.phpfreaks.com/topic/190547-if-bigger-than-100/#findComment-1005028
Share on other sites

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.