adv Posted November 11, 2007 Share Posted November 11, 2007 you have this : if ($var=="10") { echo "ok"; }else{ echo "not ok"; } and u can do this echo ($var=="10) ? "ok":"not ok"; this u do with if but is there a way to do that with elseif is there a shortcut for elseif ? Link to comment https://forums.phpfreaks.com/topic/76898-solved-ternary-question/ Share on other sites More sharing options...
GingerRobot Posted November 11, 2007 Share Posted November 11, 2007 Edit: Ignore that As far as i know, you can't do anything using if, elseif, else statements in ternary form. Even if you could, it'd get pretty messy. Link to comment https://forums.phpfreaks.com/topic/76898-solved-ternary-question/#findComment-389335 Share on other sites More sharing options...
adv Posted November 11, 2007 Author Share Posted November 11, 2007 thanks ginger Link to comment https://forums.phpfreaks.com/topic/76898-solved-ternary-question/#findComment-389354 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.