~n[EO]n~ Posted November 15, 2007 Share Posted November 15, 2007 Hi, can someone tell me what this code is trying to do, please <?php $cat_type=$Admin_type=="Products"?1:2; // that 1:2 in the end ?> Thanks Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 15, 2007 Share Posted November 15, 2007 that is ternary operator same as if else if ($var =='cool') $teng =1; else $teng =2; ternary $teng =($var=='cool')?1:2; ? is the value if true : value if false Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 15, 2007 Author Share Posted November 15, 2007 Thanks a lot. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.