MrBelfry
IS-IT--Management
- May 21, 2003
- 289
Hey there
when using the array_search function I am running into problems. I want to delete an element from an array if it is set to a certain value. But if the key that array_search returns is 0 then PHP also thinks that means false! Which means I either don't delete the element thinking it isn't in the array OR I delete the first element even if that wasn't what I was searching for.
How can I tell if hte 0 i return is a value of false or if it is an array key?
MrBelfry
when using the array_search function I am running into problems. I want to delete an element from an array if it is set to a certain value. But if the key that array_search returns is 0 then PHP also thinks that means false! Which means I either don't delete the element thinking it isn't in the array OR I delete the first element even if that wasn't what I was searching for.
How can I tell if hte 0 i return is a value of false or if it is an array key?
MrBelfry