Google News
logo
PHP - Interview Questions
Which function is used in PHP to search a particular value in an array?
in_array() function is used to search a particular value in an array.
 
Example :
$languages = array("HTML", "CSS", "ANGULAR", "C", "Java", "PHP", "VB.Net");
if (in_array("PHP", $languages)) {
echo "PHP is in the list";
}
else {
echo "php is not in the list";
}
Advertisement