Answers for "check 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
0

is array php

$arr = 'This is not array only string';
 
if ( is_array($arr)) {    
    echo 'Available';
}
Posted by: Guest on September-25-2021

Browse Popular Code Answers by Language