How can a beginner in PHP effectively handle the task of counting the occurrences of a specific letter in a string?

To count the occurrences of a specific letter in a string in PHP, a beginner can use the `substr_count()` function. This function takes two parameters - the string to search in and the specific letter to count. By using this function, the beginner can easily determine the number of times the specified letter appears in the given string.

$string = "hello world";
$letter = 'l';
$count = substr_count($string, $letter);
echo "The letter '$letter' appears $count times in the string.";