PHP array_search() Function
Complete PHP Array Reference
Definition and Usage
The array_search() function search an array for a value and returns the key.
Syntax
array_search(value,array,strict)
|
| Parameter |
Description |
| value |
Required. Specifies the value to search for |
| array |
Required. Specifies the array to search in |
| strict |
Optional. Possible values:
When set to true, the number 5 is not the same as the string 5
(See example 2) |
Example 1
<?php
$a=array("a"=>"Dog","b"=>"Cat","c"=>"Horse");
echo array_search("Dog",$a);
?>
|
The output of the code above will be:
Example 2
<?php
$a=array("a"=>"5","b"=>5,"c"=>"5");
echo array_search(5,$a,true);
?>
|
The output of the code above will be:
Complete PHP Array Reference
Add automated outbound phone calls to your application!
 |
|
Enhance your project with this inexpensive reliable Web Service. Phone calls can be sent as pre-recorded sound files,
text to speech, or by using a combination of both. You can also
change call flow based on interaction.
Phone Notify! is being utilized for fraud prevention, emergency notification calls, courtesy calls, automated telemarketing calls, voice broadcasts, automated dialers, appointment reminders and more.
50 FREE phone calls for W3School users >
|
|