<?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;
You have javascript disabled. You will not be able to edit any code.