php - Problem in array search -


I am trying to find values ​​within an array. This array always starts at 0. Unfortunately the array_search array starts searching from element 1. Then the first element is always overlooked.

How do I start this array from 1, or array-search? Start with 0? The array comes out of an XML web service, so I can not modify the results to the rally.

See manual, it can help you:

If you do If you are trying to increase the key by one, you can do this:

my_array_search ($ needle, $ hansstack, $ string = false) {$ key = array_search ($ needle, $ Hunsack, $ strict); If (is_integer ($ key)) $ key ++; Key to return; } My_array_search ($ xml_service_array);

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -