menghitung jumlah karakter (1)

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.