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
How to submit form without a submit button.
Is php faster than javascript?
What is scope of variable in php?
What are default session time and path?
Define object-oriented methodology?
What is the difference between rest and soap?
How can you create a session in php?
What is encapsulation in php?
explain php variable length argument function.
How does php strcmp work?
How do you count numbers in php?
what is constructor
What are different types of errors available in Php?
How can we execute a php script using command line?
What is php limit?