How to search Array for multiple values in PHP?

后端 未结 5 1301
滥情空心
滥情空心 2020-12-03 13:58

I need to get the keys from values that are duplicates. I tried to use array_search and that worked fine, BUT I only got the first value as a hit.

I need to get both

5条回答
  •  不思量自难忘°
    2020-12-03 14:08

    The PHP manual states in the Return Value section of the array_search() function documentation that you can use array_keys() to accomplish this. You just need to provide the second parameter:

    $keys = array_keys($list[0], "2009-09-09");
    

提交回复
热议问题