What is the correct syntax for using in_array() function in PHP?

When using the in_array() function in PHP, the correct syntax includes passing the value to search for as the first parameter, and the array to search in as the second parameter. The function returns true if the value is found in the array, and false otherwise. It is important to note that the function is case-sensitive by default, so make sure to consider this when using it.

$value = 5;
$array = [1, 2, 3, 4, 5];

if (in_array($value, $array)) {
    echo "Value found in the array!";
} else {
    echo "Value not found in the array.";
}