In_array() function return Boolean type data and this function mostly used for check value in array exist or not such as-
<?php
$array=array(“mango”,”apple”,”orange”);
if(in_array(“apple”,$array)){
echo ‘exist’;
}else{
echo ‘not exist’;
}
?>
SWCodes- PHP, JavaScript, CakePHP, Laravel, Angularjs2, Angularjs3, Angularjs4, HTML4, HTML5, CSS, CSS3, Nodejs, Codeignitor, Vuejs Interview Question and Answers for fresher and experience,Software and Web development
In_array() function return Boolean type data and this function mostly used for check value in array exist or not such as-
<?php
$array=array(“mango”,”apple”,”orange”);
if(in_array(“apple”,$array)){
echo ‘exist’;
}else{
echo ‘not exist’;
}
?>