On Mon, Jan 09, 2012 at 10:42:59AM -0500, Marc Guay wrote:

> > some pretty natives php functions exists to do the job :
> 
> But how many times in my life will I have write echo "<pre>"; ???
> Does anyone have a handy solution? (Make this the default behavior?
> Add a "even more human-readable" flag to the function?  Create a
> simple macro in Aptana 3?)

I have an init file that I include in every site that contains a few
routines I use over and over. One such is:

function instrument($legend, $var)
{
        print $legend . "<br/>\n";;
        print "<pre><br/>\n";
        print_r($var);
        print "</pre><br/>\n";
}

I use this routine wherever I want to see what's going on. It formats
(particularly) array output so that I can read it, instead of having
everything look like JSON, which is much harder to read.

Feel free to use the above yourself as needed.

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to