Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is array_search() in php?

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


Please Help Members By Posting Answers For Below Questions

Tell me how to create a text file in php?

930


How to download and install php on windows?

1084


What is csrf cookie?

859


Why do we use htaccess and where?

959


What is the php function that removes the last element of the array and returns it?

918


What is "print" in php?

899


How values in arrays are indexed?

1006


What is the best website to learn php?

916


Explain some most commonly use string functions in php?

931


Where is the submitted form data stored?

1013


Tell me can the value of a constant change during the script's execution?

1149


What is exception handling in php?

1562


Which php function will attach one file to another?

932


Explain briefly about a search-friendly site looks like?

838


What is the difference between Split and Explode in PHP?

995