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 <me2resh@xxxxxxxxx> 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($arr[0]);. To
remove all the elements with integer indices you could just loop, check,
and unset those ones.
What do you need to do this for? Your examples looks like arrays got
from mysql_fetch_array. If this is so, using mysql_fetch_assoc() instead
of that will get you only the associative array.
Rabin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php