How can you search for a specific value in an array in PHP?

To search for a specific value in an array in PHP, you can use the `array_search()` function. This function searches for a specific value in an array and returns the corresponding key if found, or `false` if not found. You can use this function to check if a specific value exists in an array and retrieve its key if needed.

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

$key = array_search($searchValue, $array);

if ($key !== false) {
    echo "Value $searchValue found at index $key";
} else {
    echo "Value $searchValue not found in the array";
}