What is use of in_array() function in PHP ?

It helps to checks if a value exists in an array.

in_array()
<?php
$os = array(“Mac”, “Windows”, “Irix”, “Linux”);
if (in_array(“Mac”, $os)) {
    echo “Got Mac”;
}
?>