note 55669 deleted from function.var-dump by aidan
| From: | aidan@php.net | Date: | Mon, 09 Jan 2006 12:51:15 +0000 |
| Subject: | note 55669 deleted from function.var-dump by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-101448@lists.php.net to get a copy of this message | ||
Note Submitter: Dennis Pallett
----
<?php
function show($data, $func = "print_r", $return_str = false){
ob_start();
$func($data);
$output = '<pre>'.htmlspecialchars(ob_get_contents()).'</pre>';
ob_end_clean();
if($return_str) return $output; else echo $output;
}
?>
From http://keithdevens.com/weblog/archive/2004/Jul/15/PHP.show
Works perfectly for me. Makes it extermely easy to view variables, arrays and objects.