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 composer json?

913


Which php mvc framework is best?

1027


What are the different ways to login to a remote server?

1016


What is csrf token and how it works?

1003


Can you pass an array into a function?

1072


Is php used for frontend or backend?

1014


What is in php 7?

1019


Which is used to maintain the value of a variable over different pages?

1021


Explain how can php and javascript interact?

1037


Is laravel an oop?

904


What is config file in php?

1024


What does namespace mean in php?

1035


Explain the ternary conditional operator in php?

1092


What is the use of final class in php?

937


In PHP, fgets() is used to read a file one line at a time. State Whether True or False?

1174