$str = "welcome to tutorials point";
$str = str_replace(" ","",$str);
$arr = str_split($str);
foreach ($arr as $key =>$val){
if (!isset($output[$val])){
$output[$val] = 1;
}
else{
$output[$val] += 1;
}
}
foreach($output as $char =>$number){
echo $char." ".'appears '. $number." ".'times'."
";
}
?>