Das PHP Script Verzeichnis
Werbung

Worte mit Hilfe von explode zählen

<style type="text/css">
body{
display: inline;
font-family: courier;
font-size: 160%;
font-style: normal;
font-weight:1024;
color: #68677C
}
</style> 

<center> 

<table width=80 border=2><center>
    <tr>
        <td><center>
        Count Words<br>
        Enter the word / phrase in the form below 

<form method="post" action="
<input type="text" size="75" name="text"> 

<input type="submit" size="12" value=" hasil" name="submit"> 

<p>
<table bgcolor="#000000">
  <tr>
    <td>
<?
$text = $_POST['text'];
$count = count(explode(" ", $text));
 if ($text == "" ) {
echo "";
}
else 

 echo"<strong><font color=red>$text</strong></font>   </td>
  </tr>
</table></br> words typed is $count "; ?> 

</p>
</td>
    </tr>
    </form>

Quelle