AnteD wrote:
/**
 * Prints the variable in HTML format...
 *
 * @param mixed $var
 * @param bool $return return or print the var
 * @return string
 */
function print_pre($var, $return = false) {
    $retval = Â<pre>Â.print_r($var, true).</pre>Â;
    if($return) return $retval;
    print($retval);
}

ok....let the shooting begin :)

the xdebug extension has very nice html-ized var_dump(). Use that on your devel machine and you'll never need your print_pre again. Otherwise I find it easier to simply do this:


<?php
echo '<pre>';
var_dump($blah);
echo '</pre>';
?>

than to write a function and make sure it is always there.

Alternately, view source from your browser works great for grabbing var_dump()/print_r() output.

Greg

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to