Answers for "php value not in array"

PHP
18

php in array

$colors = array("red", "blue", "green"); 
 
if (in_array("red", $colors)) { 
	echo "found red in array"; 
}
Posted by: Guest on July-01-2019
0

php if in array

$os = array("Mac", "NT", "Irix", "Linux");
if (in_array("Irix", $os)) {
    echo "Got Irix";
}
if (in_array("mac", $os)) {
    echo "Got mac";
}
Posted by: Guest on June-08-2021
15

php value in array

in_array ( mixed $needle , array $haystack , bool $strict = false ) : bool
Posted by: Guest on January-28-2021

Code answers related to "php value not in array"

Browse Popular Code Answers by Language