What function can be used to match multiple occurrences of a pattern in a string in PHP?

To match multiple occurrences of a pattern in a string in PHP, you can use the `preg_match_all()` function. This function allows you to search a string for all occurrences of a specified pattern and return the matches in an array. Here is an example code snippet that demonstrates how to use `preg_match_all()` to match multiple occurrences of a pattern in a string:

$string = "The quick brown fox jumps over the lazy dog";
$pattern = "/\b\w{4}\b/"; // Match words with 4 characters

if (preg_match_all($pattern, $string, $matches)) {
    echo "Matches found: " . implode(", ", $matches[0]);
} else {
    echo "No matches found.";
}