PHP input box value character count

Normal Code PHP input text box value each character code and total how many character this word.

Code:

<form action="" method="post">
<input type="text" name="text" id="text">
<input type="submit" name="Find" id="click" value="Find" />
</form>
<?php

if(isset($_POST['Find']))
{
$name=$_POST['text'];
echo $name;
echo "<br>";
foreach(count_chars($name,1) as $i=>$val)
{
echo "Letter $val \"", chr($i), "\" .\n"."<br>";
}

$lengthname=strlen($name);
echo "Letter in name :" .$lengthname."<br>";
}
?>

Output screen


phpcount

PHP input box value character count Dev2Tricks 5 of 5
Normal Code PHP input text box value each character code and total how many character this word. Code: <form action="" me...

Share this

Related Posts

Previous
Next Post »

Xolo Offer