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
Explain what is the difference between session and cookie?
How does cookies work in php?
What are helpers in php?
How can you get the size of an image in PHP?
Is php faster than python?
Tell me what is the main difference between require() and require_once()?
Tell us how to create an array of a group of items inside an html form?
For image work which library is used in php?
What is session data?
What is default session time and path in PHP. How to change it?
What are the popular content management systems (cms) in php?
What is isset in php?
How many keywords are there in php?
What is the use of Php variables?
How do I display php errors?