tags:

views:

33

answers:

1

I have large json data which is contains hundreds thousands elements, now i need to get the ordinal position of an item inside the data with php. what is the best approach to do this rather than having loop because performance is important in this case.

Seems PHPLINQ looks promising but performance not so good.

Thanks in advanced

A: 

Hi, I would use json_decode(), array_keys() or array_values() depending on whether you are searching for a key or a value, and array_search(). I assumed the depth of your array is 1, am I right?

greg0ire
its large data with multi level array 4-5 level depth, thats why i am considering to have something like LINQ search method or XPATH
Ariel