Re: remove keys from array
| From: | tg-php at gryffyndevelopment dot com | Date: | Mon, 12 Jun 2006 20:17:09 +0000 |
| Subject: | Re: remove keys from array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-237843@lists.php.net to get a copy of this message | ||
Crap.. I remember seeing an example of something that yielded arrays like this and now I can't
find it.
It basically created an array (from a database I thought.. but can't find the example under
mysql_fetch_assoc or mysql_fetch_array... thought it was in the standard PHP documentation (not the
user comments).
Anyway, it looked just like this.
first array element key = "ID" and value = "2"
second array element key = "CategoryName" and value = "asdasd"
But you ended up with an array that merged an associative array and a regular indexed array.
So you get, in addition to the above, a 0 = 2 and 1 = asdasd.
Looks like he wants just the associative side of it.. not the indexed.
-TG
= = = Original message = = =
On Sun, June 11, 2006 6:57 am, Ahmed Abdel-Aliem wrote:
> hi all
> when i have array in the form of :
> Array ( [0] => 2 [ID] => 2 [1] => asdasd [CategoryName] => asdasd ) )
> how can i make it in the form of :
> Array ( [ID] => 2 [CategoryName] => asdasd ) )
>
> can anyone help me with that plz ?
I don't even understand the question...
Where did this array come from?
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.