Use this:
function debugPrint($mVar, $bHtml) {
if ($bHtml){
echo "<pre>";
print_r ($mVar);
echo "</pre>";
} else {
print_r ($mVar);
}
}
call it like this:
debugPrint($yourVariable,1);
This will print out any type (object,array,ressource,string...)
----- Original Message -----
From: "Sandeep Murphy" <[EMAIL PROTECTED]>
To: "'Tim Ward'" <[EMAIL PROTECTED]>; "PHP List"
<[EMAIL PROTECTED]>
Sent: Tuesday, January 22, 2002 1:00 PM
Subject: RE: [PHP] RE: Printing structure and data of array
> hi,
>
> how can I display the array exactly as it is the format specified??? like
if
> their exists sub elements of elements, how could I represent them in a
> multidimensional format??
>
> I went thru most of the array functions but unable to adapt any of them..
>
> pl help..
>
> TIA,
> sands
>
> -----Original Message-----
> From: Tim Ward [mailto:[EMAIL PROTECTED]]
> Sent: segunda-feira, 21 de Janeiro de 2002 10:24
> To: PHP List; Daniel Als�n
> Subject: [PHP] RE: Printing structure and data of array
>
>
> Foreach($array as $key=>$value) ech0("$key=>$value<br>");
>
> Tim
> www.chessish.com <http://www.chessish.com>
>
> ----------
> From: Daniel Als�n [SMTP:[EMAIL PROTECTED]]
> Sent: 20 January 2002 19:33
> To: PHP List
> Subject: Printing structure and data of array
>
> Hi,
>
> i know i have this answered before. But i can�t find that mail in
> the
> archive.
>
> How do i print an array to see both the structure and the data
> within?
> ("test" => "value", "test2" => "value2")...
>
> # Daniel Als�n | www.mindbash.com #
> # [EMAIL PROTECTED] | +46 704 86 14 92 #
> # ICQ: 63006462 | +46 8 694 82 22 #
> # PGP: http://www.mindbash.com/pgp/ #
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]