Answers for "how to check a value is present in array in php"

PHP
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

Code answers related to "how to check a value is present in array in php"

Browse Popular Code Answers by Language