Changeset 12752 for trunk/include
- Timestamp:
- Dec 16, 2011, 9:57:55 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/dblayer/functions_mysql.inc.php
r12748 r12752 635 635 } 636 636 637 // get_boolean transforms a string to a boolean value. If the string is 638 // "false" (case insensitive), then the boolean value false is returned. In 639 // any other case, true is returned. 640 function get_boolean( $string ) 641 { 642 $boolean = true; 643 if ( 'false' == strtolower($string) ) 644 { 645 $boolean = false; 646 } 647 return $boolean; 637 /** 638 * Smartly checks if a variable is equivalent to true or false 639 * 640 * @param mixed input 641 * @return bool 642 */ 643 function get_boolean($input) 644 { 645 if ('false' === strtolower($input)) 646 { 647 return false; 648 } 649 650 return (bool)$input; 648 651 } 649 652
Note: See TracChangeset
for help on using the changeset viewer.