Re: Multidimensional Array manipluation...
| From: | Dhaval Desai | Date: | Thu, 02 Jan 2003 17:17:48 +0000 |
| Subject: | Re: Multidimensional Array manipluation... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-129964@lists.php.net to get a copy of this message | ||
Hi,
Thanx for the reply, well but what about the second part or my mail..
I want to use in_array("value", $array);
and if found, I want to update the value of that variable...
$test["0"]["hey"] = 1; $test["1"]["hi"] = 2; $test["2"]["hello"] = 3;I want to update $test["0"]["hey"] and set it as 1+1; I think it's possible using splice()m I don't know exactly how to use it with Multi Dimensional arrays.... Also is there any idea on how can we count() the values in a multi dimensional arrays... Thanx
From: Chris Shiflett <shiflett@php.net> Reply-To: shiflett@php.net To: Dhaval Desai <da_linuxguru@hotmail.com>, php-general@lists.php.net Subject: Re: [PHP] Multidimensional Array manipluation... Date: Thu, 2 Jan 2003 09:04:27 -0800 (PST) --- Dhaval Desai <da_linuxguru@hotmail.com> wrote: $test[0] = "hey"; $test[1] = "hi"; $test[2] = "hello"; Now I want to hold various values in $test[0]["hey"] = "1" and $test[1]["hi"] = "2" and $test[2]["hello"] = "3" Try this instead: $test["0"]["hey"] = 1; $test["1"]["hi"] = 2; $test["2"]["hello"] = 3; Also, remember that you can often learn these types of things with trial and error by using the print_r() function: print_r($test); Chris_________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail