Lines Matching refs:array_search
2 Test array_search() function : usage variations - haystack as sub-array/object
6 * Prototype : mixed array_search ( mixed $needle, array $haystack [, bool $strict] )
11 /* checking for sub-arrays with array_search() */
12 echo "*** Testing sub-arrays with array_search() ***\n";
20 var_dump( array_search("four", $sub_array) );
22 var_dump( array_search(3, $sub_array[1]) );
23 var_dump( array_search(array('','i'), $sub_array) );
25 /* checking for objects in array_search() */
26 echo "\n*** Testing objects with array_search() ***\n";
36 var_dump( array_search("array_var", $array_search_obj) );
38 var_dump( array_search("foo", $array_search_obj) );
40 var_dump( array_search("one", $array_search_obj->array_var) );
45 *** Testing sub-arrays with array_search() ***
50 *** Testing objects with array_search() ***
52 Warning: array_search() expects parameter 2 to be array, object given in %s on line %d
55 Warning: array_search() expects parameter 2 to be array, object given in %s on line %d