"Working with Arrays" Please respond to the following:

Computer Science
Tutor: None Selected Time limit: 1 Day

Outline the differences between the value returned by the in_array() function and the array_search() function. Provide an example of a situation or scenario when each of these would be used.

Feb 16th, 2015

in_array function searches an array for a specific value. Just check it! Value exists in an array or not.  (Use only PHP4 or PHP5)

in_array(search,array,type)Type is optional. If this parameter is set to TRUE, the in_array() function searches for the search-string and specific type in the array.

array_search() function is used to search an array for a specified value, it then returns the key of a corresponding value.


array_search(value,array,strict)
Strict is optional. If this is set to TRUE, then this function will be search for identical elements in the array. Possible values are:
•   true
•   false – Default

Feb 16th, 2015

Studypool's Notebank makes it easy to buy and sell old notes, study guides, reviews, etc.
Click to visit
The Notebank
...
Feb 16th, 2015
...
Feb 16th, 2015
May 23rd, 2017
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer