![]() $search_value (required): This parameter is used to specify the element or value that the user wants to search in an array.The in_array() function takes the following three parameters, out of which two are mandatory and the remaining one is optional: If the search value occurs more than once in the array, then the first matched key is returned.Įxample 1: In the below program, we learn how to search for an array value with the help of array_search() function where the strict_parameter is set to its default value. Else it returns True if the value exists in the array. ![]() It returns a Boolean False, if the search value is not found in the array,.The array_search() function returns the corresponding element's key that is passed. If strict_parameter is set to Boolean FALSE, strictness is not retained, i.e., a string 200 will be considered same as integer 200.If strict_parameter is set to TRUE, then the function looks for similar values in the array, i.e., a string 200 will not be considered same as integer 200.By default, this parameter is set to Boolean FALSE. It represents the strictness of the array search. strict_parameter (optional): It is an optional parameter that can be set either to TRUE or FALSE. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |