Let’s create a test array:
[php] $users = [ "name" => 'Spike', "surname" => 'Johnson', "age" => 23 ];
To check whether the element is in the array, use the in_array function:
in_array('Spike', $users);//check if Spike is in the $user array;
Let’s create a test array:
[php] $users = [ "name" => 'Spike', "surname" => 'Johnson', "age" => 23 ];
To check whether the element is in the array, use the in_array function:
in_array('Spike', $users);//check if Spike is in the $user array;