RE: [PHP] print_r sucks
| From: | Jack Dempsey | Date: | Fri, 05 Oct 2001 22:09:56 +0000 |
| Subject: | RE: [PHP] print_r sucks | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70152@lists.php.net to get a copy of this message | ||
<?
$a = TRUE;
echo "<pre>";
print_r($a);
echo "\n";
var_dump($a);
echo "</pre>";
?>
i get:
<pre>1
bool(true)
</pre>
so it looks like var_dump gives more useful information, but print_r is
hardly empty...if you make $a = FALSE, then it returns...hmm, either null
string, or undef, or something like that.....so, maybe var_dump's more
useful for tests like that, and print_r for other things...
jack
-----Original Message-----
From: Martín Marqués [mailto:martin@bugs.unl.edu.ar]
Sent: Friday, October 05, 2001 5:56 PM
To: php-general@lists.php.net
Subject: [PHP] print_r sucks
Why is it that if I have a bool variable with true or false (already set)
and
I do a print_r of that variable it's empty, while var_dump gives me the true
or false value?
Just a thought!
Saludos... :-)
--
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués | mmarques@unl.edu.ar
Programador, Administrador, DBA | Centro de Telematica
Universidad Nacional
del Litoral
-----------------------------------------------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net