TeddyKiller Posted April 20, 2010 Share Posted April 20, 2010 I have a function. Yes, a function. It has a return true, and return false. Whats the quickest way to check if true or false. I have this.. if(myfunction() == false) { //its a return false! } else { //its a return true! } Link to comment https://forums.phpfreaks.com/topic/199190-if-function-is-false/ Share on other sites More sharing options...
Gekk0 Posted April 20, 2010 Share Posted April 20, 2010 yeah that should work make sure your function is returning the correct values though so like return true; or return false; am I making sense? Link to comment https://forums.phpfreaks.com/topic/199190-if-function-is-false/#findComment-1045452 Share on other sites More sharing options...
TeddyKiller Posted April 20, 2010 Author Share Posted April 20, 2010 Ok cheers! Link to comment https://forums.phpfreaks.com/topic/199190-if-function-is-false/#findComment-1045455 Share on other sites More sharing options...
ignace Posted April 20, 2010 Share Posted April 20, 2010 make sure your function is returning the correct values though He's using == so "", 0, 0.0, "0", array(), null should all pass myfunction() == false Link to comment https://forums.phpfreaks.com/topic/199190-if-function-is-false/#findComment-1045475 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.