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

explain php variable length argument function.

1060


What is php variable?

1004


What does the scope of variables means?

1015


What are the steps for the payment gateway processing?

1008


How do you trim spaces in excel?

1022


How to convert strings in hex format?

1028


Why do we use session?

1003


What is difference between echo and print_r in php?

885


How to merge values of two arrays into a single array?

1020


What is the use of mysql_real_escape_string() function?

931


What are the ways to include file in php?

995


Explain the three different kinds of Arrays?

1190


How do you end a function in python?

1010


Explain Traits in PHP?

950


How can I load data from a text file into a table?

1002