Position of element in array
| From: | PHP4Beta List | Date: | Mon, 06 Mar 2000 15:29:17 +0000 |
| Subject: | Position of element in array | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-11582@lists.php.net to get a copy of this message | ||
I've recently been trying to delete an entry in the middle of a two dimensional array. While
looking throught the multitude of array functions in the manual, I found that array_splice() could
possibly work. I have only found one problem though. The array_splice(...) requires an argument
where the offset is the position you want the splice to start. The only problem with this is that
the two dimensional array I am working with is associative, and there is no way I can know the
position of an entry two dimensions deep w/o making my own custom search function (which I could do
if I wanted to). So I guess as a recomendation to all you PHP developers, it would be really cool
if you could make a search function that returns the position, not just true or false. Or if there
is some function that already does this, please excuse my ignorance, and please clue me in on this
truely great function.
--
Gerrit Padgham
gpadgham@perfectorder.com
Consultant