Hi Morgan,
You tip is fantastic. Will post it (with your permission) at my weblog,
http://php.weblogs.com/ tomorrow.
Regards, John
"Morgan Curley" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I generally include the following function:
> function
I use print_r on arrays, and var_dump on everything else.
print_r will not tell you if a variable is NULL, but var_dump will. So I
usually use both.
--
Plutarck
Should be working on something...
...but forgot what it was.
""John Lim"" <[EMAIL PROTECTED]> wrote in message
9asuq0$f1n$[EMAIL PRO
I generally include the following function:
function dump( $label, $input ){
echo( "" );
echo( "$label\n" );
print_r( $input );
echo( "" );
return 1;
}
or if you like javascript this pops up an
Here's some info about the two functions.
Descriptions (from manual) :
print_r -- Prints human-readable information about a variable
(PHP 4)
var_dump -- Dumps information about a variable
(PHP 3 >= 3.0.5, PHP 4)
An example
Just a question that has been besetting me for a while:
which is better for debugging -- vardump( ) or print( ) ?
Does anyone have a preference? Why? Is one better than the other?
Thanks for answering this prickly question!
John Lim
--
PHP General Mailing List (http://www.php.net/)
To unsub
5 matches
Mail list logo