| 13 |
* $Id$ |
* $Id$ |
| 14 |
* |
* |
| 15 |
* $Log$ |
* $Log$ |
| 16 |
|
* Revision 1.9 2005/08/11 14:06:26 jonen |
| 17 |
|
* + added generic array-key sorting function |
| 18 |
|
* |
| 19 |
|
* Revision 1.8 2004/07/21 12:56:19 joko |
| 20 |
|
* php5 compatibility |
| 21 |
|
* |
| 22 |
* Revision 1.7 2003/06/25 23:41:14 joko |
* Revision 1.7 2003/06/25 23:41:14 joko |
| 23 |
* now using "global $Dumper_mode" |
* now using "global $Dumper_mode" |
| 24 |
* |
* |
| 435 |
|
|
| 436 |
// from: http://www.php.net/manual/en/function.method-exists.php |
// from: http://www.php.net/manual/en/function.method-exists.php |
| 437 |
function class_has_method($className, $methodName) { |
function class_has_method($className, $methodName) { |
| 438 |
$bool_exists = (in_array(strtolower($methodName), get_class_methods($className))); |
|
| 439 |
|
// new as of 2004-07-21: php5 compatibility |
| 440 |
|
// taken from http://php.net/manual/en/function.version-compare.php |
| 441 |
|
if (version_compare(phpversion(), "5.0.0", "<")) { |
| 442 |
|
$methodName = strtolower($methodName); |
| 443 |
|
} |
| 444 |
|
|
| 445 |
|
$bool_exists = (in_array($methodName, get_class_methods($className))); |
| 446 |
return $bool_exists; |
return $bool_exists; |
| 447 |
} |
} |
| 448 |
|
|
| 724 |
function even($var) { |
function even($var) { |
| 725 |
return ($var % 2 == 0); |
return ($var % 2 == 0); |
| 726 |
} |
} |
| 727 |
|
|
| 728 |
|
// modified version from: http://de.php.net/manual/en/function.array-multisort.php |
| 729 |
|
// compare values of two array-keys |
| 730 |
|
// usage: asort($array, "comparar_caption"); |
| 731 |
|
function comparar_caption($a, $b, $key_name="caption") { |
| 732 |
|
return strnatcasecmp($a[$key_name], $b[$key_name]); |
| 733 |
|
} |
| 734 |
|
|
| 735 |
|
|
| 736 |
} |
} |
| 737 |
|
|