Dec 12, 2005 #1 jbezzina MIS May 4, 2004 46 MT Why am I getting that $num is greater than seven when it's clear that this its not. <?PHP $num = 7; echo ($num==7) ? "num is seven" : ($num>7) ? "num is greater than seven" : "num is an unknown"; ?>
Why am I getting that $num is greater than seven when it's clear that this its not. <?PHP $num = 7; echo ($num==7) ? "num is seven" : ($num>7) ? "num is greater than seven" : "num is an unknown"; ?>
Dec 12, 2005 #2 Dweezel Technical User Feb 12, 2004 428 GB You've got a problem with where you've placed the braces there I think. Try this: Code: <?PHP $num = 7; echo $num==7 ? "num is seven" : ($num>7 ? "num is greater than seven" : "num is an unknown"); ?> Upvote 0 Downvote
You've got a problem with where you've placed the braces there I think. Try this: Code: <?PHP $num = 7; echo $num==7 ? "num is seven" : ($num>7 ? "num is greater than seven" : "num is an unknown"); ?>