|
| |
1 |
|
<?php |
|
| |
2 |
|
|
|
| |
3 |
|
|
|
| |
4 |
|
|
|
| |
5 |
|
|
|
| |
6 |
|
|
|
| |
7 |
|
|
|
| |
8 |
|
|
|
| |
9 |
|
|
|
| |
10 |
|
|
|
| |
11 |
|
|
|
| |
12 |
|
|
|
| |
13 |
|
|
|
| |
14 |
|
|
|
| |
15 |
|
|
|
| |
16 |
|
|
|
| |
17 |
|
|
|
| |
18 |
|
|
|
| |
19 |
|
|
|
| |
20 |
|
|
|
| |
21 |
|
|
|
| |
22 |
|
|
|
| |
23 |
|
|
|
| |
24 |
|
|
|
| |
25 |
|
|
|
| |
26 |
|
|
|
| |
27 |
|
|
|
| |
28 |
|
|
|
| |
29 |
|
|
|
| |
30 |
|
|
|
| |
31 |
|
|
|
| |
32 |
|
|
|
| |
33 |
|
|
|
| |
34 |
|
if (!function_exists('var_export')) |
|
| |
35 |
|
{ |
|
| |
36 |
|
function var_export ($array, $return = false) |
|
| |
37 |
|
{ |
|
| |
38 |
|
|
|
| |
39 |
|
$indent = ' '; |
|
| |
40 |
|
$doublearrow = ' => '; |
|
| |
41 |
|
$lineend = ",\n"; |
|
| |
42 |
|
$stringdelim = '\''; |
|
| |
43 |
|
$newline = "\n"; |
|
| |
44 |
|
|
|
| |
45 |
|
|
|
| |
46 |
|
if (is_string($array)) { |
|
| |
47 |
|
$out = $stringdelim . $array . $stringdelim; |
|
| |
48 |
|
} |
|
| |
49 |
|
elseif (is_int($array)) { |
|
| |
50 |
|
$out = (string)$array; |
|
| |
51 |
|
} |
|
| |
52 |
|
|
|
| |
53 |
|
|
|
| |
54 |
|
else |
|
| |
55 |
|
{ |
|
| |
56 |
|
|
|
| |
57 |
|
$out = "array (\n"; |
|
| |
58 |
|
|
|
| |
59 |
|
|
|
| |
60 |
|
foreach ($array as $key => $value) |
|
| |
61 |
|
{ |
|
| |
62 |
|
|
|
| |
63 |
|
if (is_string($key)) { |
|
| |
64 |
|
$key = $stringdelim . addslashes($key) . $stringdelim; |
|
| |
65 |
|
} |
|
| |
66 |
|
|
|
| |
67 |
|
|
|
| |
68 |
|
if (is_string($value)) { |
|
| |
69 |
|
$value = $stringdelim . addslashes($value) . $stringdelim; |
|
| |
70 |
|
} |
|
| |
71 |
|
|
|
| |
72 |
|
|
|
| |
73 |
|
elseif (is_array($value)) |
|
| |
74 |
|
{ |
|
| |
75 |
|
|
|
| |
76 |
|
$recur_array = explode($newline, var_export($value, true)); |
|
| |
77 |
|
$recur_newarr = array (); |
|
| |
78 |
|
foreach ($recur_array as $recur_line) { |
|
| |
79 |
|
$recur_newarr[] = $indent . $recur_line; |
|
| |
80 |
|
} |
|
| |
81 |
|
$recur_array = implode($newline, $recur_newarr); |
|
| |
82 |
|
$value = $newline . $recur_array; |
|
| |
83 |
|
} |
|
| |
84 |
|
|
|
| |
85 |
|
|
|
| |
86 |
|
$out .= $indent . $key . $doublearrow . $value . $lineend; |
|
| |
87 |
|
} |
|
| |
88 |
|
|
|
| |
89 |
|
|
|
| |
90 |
|
$out .= ")"; |
|
| |
91 |
|
} |
|
| |
92 |
|
|
|
| |
93 |
|
|
|
| |
94 |
|
|
|
| |
95 |
|
if ($return === true) { |
|
| |
96 |
|
return $out; |
|
| |
97 |
|
} else { |
|
| |
98 |
|
echo $out; |
|
| |
99 |
|
return null; |
|
| |
100 |
|
} |
|
| |
101 |
|
} |
|
| |
102 |
|
} |
|
| |
103 |
|
?> |