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

What is Mcrypt used for?

954


What is the empty function?

900


Tell me in php, objects are they passed by value or by reference?

925


What is php trait?

930


How are sessions maintained?

897


What is the use of namespace in php?

949


What are the final class and final method?

973


Tell us why did you choose this particular career path?

911


How to receive a cookie from the browser?

1053


How to repeat a string to a specific number of times in php?

941


What is url encoding and decoding in php?

1043


Is php 5 still supported?

945


How do you compare strings in java?

871


How to find current date and time?

967


What is session in c#?

957