RE: [PHP] remove keys from array

2006-06-19 Thread Daevid Vincent
- > From: Richard Lynch [mailto:[EMAIL PROTECTED] > Sent: Monday, June 12, 2006 12:49 PM > To: Ahmed Abdel-Aliem > Cc: php-general@lists.php.net > Subject: Re: [PHP] remove keys from array > > On Sun, June 11, 2006 6:57 am, Ahmed Abdel-Aliem wrote: > > hi all >

Re: [PHP] remove keys from array

2006-06-12 Thread afan
This looks to me as printet result array from database: $query = mysql_query("select * from table"); $result = mysql_fetch_array($query); if you print_r($result); you'll get "doubled" values. use $result = mysql_fetch_array($query, MYSQL_ASSOC); for "singles" check: http://us2.php.net/manual/en/f

Re: [PHP] remove keys from array

2006-06-12 Thread tg-php
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

Re: [PHP] remove keys from array

2006-06-12 Thread Richard Lynch
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 ?

Re: [PHP] remove keys from array

2006-06-11 Thread Afan Pasalic
if you pull this array from mysql use this: $query = mysql_query("SELECT * FROM table"); $result = mysql_fetch_array($query, MYSQL_ASSOC); -afan Rabin Vincent wrote: On 6/11/06, Ahmed Abdel-Aliem <[EMAIL PROTECTED]> wrote: when i have array in the form of : Array ( [0] => 2 [ID] => 2 [1] => as

Re: [PHP] remove keys from array

2006-06-11 Thread Rabin Vincent
On 6/11/06, Ahmed Abdel-Aliem <[EMAIL PROTECTED]> wrote: 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 ) ) To remove a single element you can use unset: unset

[PHP] remove keys from array

2006-06-11 Thread Ahmed Abdel-Aliem
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 ? -- Ahmed Abdel-Aliem Web Developer www.SafariStudio.net +2010110855