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
What's the difference between accessing a class method via -> and via ::?
Tell me how do you define a constant?
How to delete file in php?
How to generate a form?
How to randomly retrieve a value from an array?
How the result set of mysql be handled in php?
What is php call function?
What is the difference between null and empty?
What are the environmental variables?
How many types of php are there?
What is the tags in PHP is not a valid way to begin and end a PHP code block?
Explain the purpose of output buffering in php.
How to find length of an array in php ?
What is smarty?
How to take a substring from a given string in php?