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

Tell me how can you pass a variable by reference?

894


What are php expressions?

1029


What is php artisan serve?

925


Php error constants and their descriptions

1100


How to remove duplicate values from array using php?

970


When use javascript vs php?

969


What is array function in javascript?

950


Can age be a variable?

886


What is meant by variable variables in php?

944


How can we enable error reporting in php?

959


What are objects in php?

918


What is associative array in php?

956


What are the encryption functions available in PHP?

1063


Tell me how a constant is defined in a php script?

876


What is __ construct in php?

958