@@ 223-242 (lines=20) @@ | ||
220 | * @param mixed $var variable to dump |
|
221 | * @return string |
|
222 | */ |
|
223 | function array2string($var) |
|
224 | { |
|
225 | switch (($type = gettype($var))) |
|
226 | { |
|
227 | case 'boolean': |
|
228 | return $var ? 'TRUE' : 'FALSE'; |
|
229 | case 'string': |
|
230 | return "'$var'"; |
|
231 | case 'integer': |
|
232 | case 'double': |
|
233 | case 'resource': |
|
234 | return $var; |
|
235 | case 'NULL': |
|
236 | return 'NULL'; |
|
237 | case 'object': |
|
238 | case 'array': |
|
239 | return str_replace(array("\n",' '/*,'Array'*/),'',print_r($var,true)); |
|
240 | } |
|
241 | return 'UNKNOWN TYPE!'; |
|
242 | } |
|
243 | ||
244 | /** |
|
245 | * Check if a given extension is loaded or load it if possible (requires sometimes disabled or unavailable dl function) |
@@ 1374-1393 (lines=20) @@ | ||
1371 | * @param mixed $var variable to dump |
|
1372 | * @return string |
|
1373 | */ |
|
1374 | function array2string($var) |
|
1375 | { |
|
1376 | switch (($type = gettype($var))) |
|
1377 | { |
|
1378 | case 'boolean': |
|
1379 | return $var ? 'TRUE' : 'FALSE'; |
|
1380 | case 'string': |
|
1381 | return "'$var'"; |
|
1382 | case 'integer': |
|
1383 | case 'double': |
|
1384 | case 'resource': |
|
1385 | return $var; |
|
1386 | case 'NULL': |
|
1387 | return 'NULL'; |
|
1388 | case 'object': |
|
1389 | case 'array': |
|
1390 | return str_replace(array("\n",' '/*,'Array'*/),'',print_r($var,true)); |
|
1391 | } |
|
1392 | return 'UNKNOWN TYPE!'; |
|
1393 | } |
|
1394 | ||
1395 | /** |
|
1396 | * Give usage information and an optional error-message, before stoping program execution with exit-code 90 or 0 |