I want to check how many instances of the letter a appears in a certain string.
a
What is the function for this? I need it to return an integer value.
You can use the function : substr_count
Example:
$str = "I love stackoverflow"; echo substr_count($str,'o'); // prints 3