View Single Post
Old 06-25-2009, 06:51 PM   #1 (permalink)
tech
The Wanderer
 
Join Date: Jun 2009
Posts: 20
Thanks: 2
tech is on a distinguished road
Default how to delete an element from an array without knowing its index position

dear friends..
Any one please help me to write a code to delete an element from an array where i don't know the index position of an element.and i wanted to use array_splice if possible.
example:
$x=array("a","b","c","d");
array_splice($a,2,1);//if i want to delete "b" from an array
print_r($x);

here i know about the position but if i don't know about the position of an element then how can i do?

thanks..
tech is offline  
Reply With Quote