How can PHP documentation be effectively utilized to solve issues related to string manipulation and counting occurrences?

Issue: When dealing with string manipulation and counting occurrences in PHP, it is important to refer to the PHP documentation for built-in functions that can help accomplish these tasks efficiently. Functions like `strlen()` for getting the length of a string, `substr_count()` for counting occurrences of a substring, and `str_replace()` for replacing occurrences within a string can be particularly useful.

// Example of using PHP functions for string manipulation and counting occurrences

$string = "Hello, World!";
$substring = "o";

// Get the length of the string
$length = strlen($string);
echo "Length of the string: " . $length . "\n";

// Count occurrences of a substring
$count = substr_count($string, $substring);
echo "Occurrences of '" . $substring . "': " . $count . "\n";

// Replace occurrences of a substring
$newString = str_replace($substring, "X", $string);
echo "String with replaced occurrences: " . $newString . "\n";