Answer Posted / binu.v.pillai
It will search a particular value in an array and if it
find that , it will return corresponding index
<?php
$fruitArray = array(0 => 'orange', 1 => 'apple', 2
=> 'mango', 3 => 'grapes');
$key = array_search('apple', $fruitArray); // $key = 1;
$key = array_search('orange', $fruitArray); // $key = 0;
?>
| Is This Answer Correct ? | 13 Yes | 0 No |
Post New Answer View All Answers
Why would we use === instead of ==?
What does the arrow mean in php?
Will react hooks replace redux?
Explain what does the unset() function means?
What is meant by PEAR in PHP?
What is the difference between session_unregister() and session_unset()?
What is session php?
What is the php function that removes the last element of the array and returns it?
A process can run only in the background. State Whether True or False?
Explain what is meant by pear in php?
What is difference between ksort() and usort() functions.
What is use of header() function in php? What the limitation of header()?
What is use of count() function in php?
Tell me what is htaccess?
How to call a php function from another php file?