Compare associative array with standard array values PHP -
I have a set of ID and name in an associative array and in my other array I have my list of IDs I want to compare against the first list.
I want to be able to do an intersection type search function without losing name from associate array.
However, I am doing a nested advance, but it seems that this process can take forever because both arrays can potentially contain 70k + values.
$ assoc = array ('a' = & gt; 'one', 'b '= & Gt;' two ',); $ Array = array ('b', 'c', 'd'); $ Match = array_intersect_key ($ assoc, array_flip ($ array)); Print_r ($ match);
Output:
array ([b] = & gt; two)
I believe that you What are you after 're.
Comments
Post a Comment