It's a slightly different format, but print_r($array) recursively echo the
contents of an array ina readable format?
http://php.net/print_r
Why reinvent the wheel, unless you need that specific format.
HTH
Justin
on 27/09/02 3:50 AM, Brad Harriger ([EMAIL PROTECTED]) wrote:
> I'm trying
: "debbie_dyer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 26, 2002 1:23 PM
Subject: Re: [PHP] Displaying full array contents
Easier yes and ok for debug but it doesnt look very nice on a web page does
it nor does it help if you want to do so
eptember 26, 2002 9:17 PM
Subject: Re: [PHP] Displaying full array contents
> print_r($array); simply print out the entire array..
> It cant be easier.
>
> "Debbie_dyer" <[EMAIL PROTECTED]> wrote in message
> 01bf01c26598$1d84ec00$0100a8c0@homepc">news:01bf0
>
> Debbie
>
> - Original Message -
> From: "Brad Harriger" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, September 26, 2002 8:46 PM
> Subject: Re: [PHP] Displaying full array contents
>
>
> > Debb
From: "Brad Harriger" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 26, 2002 8:46 PM
Subject: Re: [PHP] Displaying full array contents
> Debbie,
>
> Yes. I could use recursion, but what's really hanging me up is keeping
> track
Debbie,
Yes. I could use recursion, but what's really hanging me up is keeping
track of how deep into an array I am. It should be fairly simple, but I
seem to be having a brain freeze.
Brad
Debbie_dyer wrote:
> You could use recursion example:-
>
> function printArray($arr) {
> fo
You could use recursion example:-
function printArray($arr) {
for ($i =0; $i < count($arr); $i++) {
if (!is_array($arr[$i])) {
echo $arr[$i];
}
else {
printArray($arr[$i]);
}
}
}
$arr = array("Orange", "Peach", "Apple");
$arr2 = array("Banana"
7 matches
Mail list logo