On 01 October 2003 11:25, Angelo Zanetti contributed these pearls of wisdom:

> Hi
> 
> If I have an array and want to remove and element from this
> array. correct me if this is the wrong approach:

It's the wrong approach ;)
 
> create a temporary array with 1 element less than the
> origional array, get the position of the element ( is there a
> function for this?) and then run through the origional array
> copying all elements besides the element which is meant to be
> removed. 
> 
> Is there no function to do this? It seems like alot of
> overhead to do this process, especially if the array is big.
> comments? 

unset($array[$key]);

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to