3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $text="Welcome to PHP"; $searchchar="e"; $count="0"; //zero for($i="0"; $i<strlen($text); $i=$i+1){ if(substr($text,$i,1)==$searchchar){ $count=$count+1; } } echo $count;
Output for 4.3.0 - 7.1.0
2