> let's say there is an array with 10 elements.
> One of elements has value 'xyz123' - I do not know which one.
> How can I extract this element from the array and
> have a new array with all other element, except extracted one.
// original array
$arr = array("a", "b", "c", "d", "xyz123", "f", "g");
// list of values to remove
$remove = array("xyz123");
// do it
$result = array_diff($arr, $remove);
// show results
foreach($result as $val)
echo "<br>$val";
"Steen rabøl" <[EMAIL PROTECTED]> escribió en el mensaje
009a01c1098d$049a62f0$0300000a@srjhp">news:009a01c1098d$049a62f0$0300000a@srjhp...
Hi
How can I remove a vale from a array()
eg;
$a = array("1","2","3");
if I then unset($a[1]) the value is NULL, or the offset is empty, and you
get a error if yoy try to access that element.
What I want/need is a function whic can remove a valy/key from a array
Does such a function exists ?
Thanks in advance
Steen
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]