berikut aplikasi penghitung karakter :
<html>
<title> Menghitung Jumlah Karakter </title>
<body>
<form name=”input” action=”hitung.php” method=”post”>
<p>Masukan Kalimat :
<textarea name=”jumlah” rows=”30″ cols=”150″></textarea>
<br>
<input type=”Submit” value=”Hasil”>
</p>
</form>
</body>
</html>
untuk penghitungannya :
<?
$datum = $_REQUEST['jumlah'];
$data=strtoupper($datum);
$jum1=array();
$result = (count_chars($data,0));
for ($i=0; $i < (sizeof($result)); $i++)
{
if ($result[$i]) {
if ((chr($i) >= ‘A’ && chr($i) <= ‘Z’ ))
echo (“”.(chr($i)).” = $result[$i] huruf <br>”);
}
}
?>

Advertisement