newbtophp Posted September 2, 2010 Share Posted September 2, 2010 How can I check if a function has returned false.. I know theirs the following way: if (!checkdate($month, $day, $year)) { //the function has returned false } But is their another way (beside using the ! operator) perhaps === FALSE (not sure if that'd work so asking)? Link to comment https://forums.phpfreaks.com/topic/212323-check-if-function-returns-false/ Share on other sites More sharing options...
premiso Posted September 2, 2010 Share Posted September 2, 2010 if (function($params) === false) // check if the return value is EXACTLY false, so the type is required to be boolean. if (function($params) == false) // Just requires the data to be null, 0, '' or false. if (!function($params)) // Just requires the data to be null, 0, '' or false. Link to comment https://forums.phpfreaks.com/topic/212323-check-if-function-returns-false/#findComment-1106277 Share on other sites More sharing options...
newbtophp Posted September 2, 2010 Author Share Posted September 2, 2010 cheers premiso! Link to comment https://forums.phpfreaks.com/topic/212323-check-if-function-returns-false/#findComment-1106278 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.