I haven't tested this so I don't know if it will be faster or not (or even if it is bug and typo free)
$arrString = split(" ", $longstringofhellos);
$arrStrCount = array();
foreach ($arrString as $value) {
$arrStrCount[$value]++;
if (($value == "Hello") && ($arrStrCount["Hello"] > 20)) {
break;
}
}
Like I said I haven't tested it, so it might actually be slower. The memory needed for the $arrString is probably more than whatever is needed for one of PHP's functions.