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

Explain about getters and setters in php?

1050


What is difference between require_once(), require(), include()?

992


What is overloading in php?

990


Where are php configuration settings stored?

1011


How to convert strings to upper or lower cases?

994


How to create a session? How to set a value in session? How to remove data from a session?

964


How to redirect https to http url through .htaccess?

947


How to find datatype of variable in php?

987


What is session and Cokkies . How it works . tell some thing about Session_id()

1934


What is the meaning of ‘escaping to php’?

1081


Do you know what is the function func_num_args() used for?

1008


Why laravel is the best php framework in 2019?

947


What is the difference between null and empty?

1006


What is the main difference between php 4 and php 5?

968


Does php 7 support mysql?

997