What function can be used to count the number of occurrences of a specific letter in a string in PHP?
To count the number of occurrences of a specific letter in a string in PHP, you can use the `substr_count()` function. This function takes two parameters: the string to search in and the specific letter to count. It returns the number of times the letter appears in the string. By using this function, you can easily determine how many times a particular letter occurs in a given string.
$string = "hello world";
$letter = 'l';
$count = substr_count($string, $letter);
echo "The letter '$letter' appears $count times in the string.";