| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
if (!function_exists('floatval')) { |
|---|
| 9 |
function floatval($string) { |
|---|
| 10 |
return ((float) $string); |
|---|
| 11 |
} |
|---|
| 12 |
} |
|---|
| 13 |
|
|---|
| 14 |
if (!function_exists('is_a')) { |
|---|
| 15 |
function is_a($object, $class) { |
|---|
| 16 |
|
|---|
| 17 |
if (get_class($object) == strtolower($class)) { |
|---|
| 18 |
return true; |
|---|
| 19 |
} else { |
|---|
| 20 |
return is_subclass_of($object, $class); |
|---|
| 21 |
} |
|---|
| 22 |
} |
|---|
| 23 |
} |
|---|
| 24 |
|
|---|
| 25 |
if (!function_exists('ob_clean')) { |
|---|
| 26 |
function ob_clean() { |
|---|
| 27 |
|
|---|
| 28 |
if (@ob_end_clean()) { |
|---|
| 29 |
return ob_start(); |
|---|
| 30 |
} |
|---|
| 31 |
return false; |
|---|
| 32 |
} |
|---|
| 33 |
} |
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
function printr($var, $do_not_echo = false) { |
|---|
| 39 |
|
|---|
| 40 |
ob_start(); |
|---|
| 41 |
print_r($var); |
|---|
| 42 |
$code = htmlentities(ob_get_contents()); |
|---|
| 43 |
ob_clean(); |
|---|
| 44 |
if (!$do_not_echo) { |
|---|
| 45 |
echo "<pre>$code</pre>"; |
|---|
| 46 |
} |
|---|
| 47 |
return $code; |
|---|
| 48 |
} |
|---|
| 49 |
|
|---|
| 50 |
if (!defined('CASE_LOWER')) { |
|---|
| 51 |
define('CASE_LOWER', 0); |
|---|
| 52 |
} |
|---|
| 53 |
|
|---|
| 54 |
if (!defined('CASE_UPPER')) { |
|---|
| 55 |
define('CASE_UPPER', 1); |
|---|
| 56 |
} |
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
if (!function_exists('array_change_key_case')) { |
|---|
| 72 |
function array_change_key_case($input, $case = CASE_LOWER) |
|---|
| 73 |
{ |
|---|
| 74 |
if (!is_array($input)) { |
|---|
| 75 |
user_error('array_change_key_case(): The argument should be an array', |
|---|
| 76 |
E_USER_WARNING); |
|---|
| 77 |
return false; |
|---|
| 78 |
} |
|---|
| 79 |
|
|---|
| 80 |
$output = array (); |
|---|
| 81 |
$keys = array_keys($input); |
|---|
| 82 |
$casefunc = ($case == CASE_LOWER) ? 'strtolower' : 'strtoupper'; |
|---|
| 83 |
|
|---|
| 84 |
foreach ($keys as $key) { |
|---|
| 85 |
$output[$casefunc($key)] = $input[$key]; |
|---|
| 86 |
} |
|---|
| 87 |
|
|---|
| 88 |
return $output; |
|---|
| 89 |
} |
|---|
| 90 |
} |
|---|
| 91 |
|
|---|
| 92 |
?> |
|---|