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 / deep

The above answer is correct. I will just add a complete
example.

<?php
$os = array("Mac", "NT", "Irix", "Linux");
if (in_array("Irix", $os))
{
echo "Got Irix";
}
if (in_array("mac", $os))
{
echo "Got mac";
}
?>

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to write the form tag correctly for uploading files?

960


What is polymorphism with example in php?

942


How can you create a session in php?

1051


What are the functions for imap?

1108


What is php destruct?

956


What are the methods of array in java?

948


Tell me how to retrieve a cookie value?

1016


How to add comments in php?

993


Explain what is smarty?

1049


Explain why would we use === instead of ==?

928


What does mysqli_query return?

939


Why shouldn't I use mysql_* functions in php?

1071


Explain me the difference between include and require?

919


What is php variable?

999


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

1171