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
What is trait in php?
Write a program to get lcm of two numbers using php?
if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer
What is the difference between $name and $$name?
What are majic methords in php?
How to receive a cookie from the browser?
How is it possible to know the number of rows returned in result set?
How a constant is defined in a php script?
How does php session work?
Is learning php easy?
So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?
What is list in PHP?
What is api used for?
Should I learn php before wordpress?
How to swap two variables without using 3rd temp variable.