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.
substr_count is probably the most straightforward. you can also do this
$str = "I love stackovaerflowa"; print count(explode("a",$str))-1;