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
How do you parse and process html/xml in php?
What are the php functions?
What is namespace and use in php?
What is the difference between for and foreach in php?
how to detect a mobile device using php
What is the use of mysql_real_escape_string() function?
What is the best practice for running mysql queries in php? Consider the risk of sql injection.
What is the difference between $message and $$message in php?
What are the differences between php constants and variables?
What is the use of curl()?
How to write the form tag correctly for uploading files?
When to use inquire vs enquire?
What is session and why do we use it?
Do you know what is the use of rand() in php?
What is regex in html?