benphp Posted May 17, 2013 Share Posted May 17, 2013 (edited) For example, can I do: if ($test == "yes") $myOp = ">"; } else { $myOp = "<"; } I know this doesn't work, but is there a way to do this with curly brackets? And then: if (($img == "0" && $textCount $myOp 1000) || $img == "") { //do this } Edited May 17, 2013 by benphp Quote Link to comment Share on other sites More sharing options...
Jessica Posted May 17, 2013 Share Posted May 17, 2013 You could use eval() but most likely you're doing something else wrong. Quote Link to comment Share on other sites More sharing options...
Solution Psycho Posted May 17, 2013 Solution Share Posted May 17, 2013 This would be better $firstTest = ($test == "yes") ? ($textCount > 1000) : ($textCount < 1000); if (($img == "0" && $firstTest) || $img == "") { //do this } 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.