for ($index=1; $index<=$news_count; $index++) { if (in_array($title[$index], $temp_title)) { print "\n Match : $title[$index]"; $key= key($temp_title); print "\n Key : $key"; }
This is the above code to an app I've written comparing one array against another. The problem is I need to find the key for $temp_title which $title[$index[ matched. Any Idea's. 'Current' or 'key' neither work.
Scott
Hi,
try to use array_search. The PDF Manual says:
mixed array_search (mixed needle, array haystack, bool strict)
Searches the array for a given value and returns the corresponding key if successful
Hope it helps, Gauss
Does not work in my vers of PHP, PHP.NET says CVS only. Have know Idea what that means.