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...

How can I check if a value is already in an array?

Answer Posted / mohammed khalid khan

The first answer is not complete.
&
The second answer is correct.


<?php
$values = array("banana","apple","pear","banana");
if (in_array("pear",$values))
{
echo "Got pear";
}
?>

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is laracast?

1011


What are the encryption functions available in PHP?

1120


What is the difference between explode and split?

1064


Explain what are psrs?

938


What is php sequence?

935


How to assigning a new character in a string using php?

1170


How to remove an empty directory?

1031


How to make database connection in php?

1027


What is the difference server side and browser side validation?

989


Explain briefly about a search-friendly site looks like?

893


What is htaccess in php?

1262


Explain me what is the difference between explode() and split() functions?

1071


Are php variables global?

1003


What is data type in php?

1038


Why is used in php?

949