How To Count And Break A Word Into An Array In Php Tutorial Guide



How To Count And Break A Word Into An Array In Php Tutorial Guide
 (382) Find work at Home Jobs
How To Count And Break A Word Into An Array In Php Tutorial Guide
Post Description:
Post Tags: how, to, count, and, break, a, word, into, an, array, in, php, tutorial, guide
This Post Has Been Viewed 312 Times Since Thu Jun 28, 2007 12:06 pm Posted By hostman with 1 replies
Next Post »» how to break a word into letters in array in php
How To Count And Break A Word Into An Array In Php Tutorial Guide

this step by step tutorial provided free by Webune Hosting

breaking down a word or a string into individual strings is possible through php. you can lear from this simple and easy to use tutorial

this is a simple script we wrote to show you how you can do this,

this is a rough and raw script, nothing fancy, just enough to show you how you can break down a word using an array and a loop then disaply each letter from that word

to see this script in action just copy and paste the code below into notepad and then copy and paste into notepad or any text editor, then save it as word-splitter.php and upload to your php website, then open it with your browser and you can test it out for yourself, you will break down whatever word you enter into separate arrays each containing their own string for each word

<img src="http://webune.com/images/headers/default_logo.jpg">
<h1>Breaking down a word into an array by webune.com</h1><hr>
<?
if(isset($_REQUEST['Submit']))
{
# FORM HAS BEEN SUMBITTED

$str = $_POST['name'];
$num_char = strlen($str);
echo "You entered: <strong>".$str."</strong><br>";
echo "Number of Characters found: <strong>".$num_char."</strong><br>";
$num_char = $num_char - 1;
echo '<br><table>';
for($counter =0; $counter <= $num_char; $counter++)
{
echo '<tr><td>Letter '.$counter.': </td><td><strong>'.$str[$counter],'</strong></td></tr>';

}
echo '</table><br>';
echo '<strong><a href="http://www.webune.com">Continue >></a></strong>';

}
else
{
# FORM HAS NOT BEEN SUBMITTED
?>

 

<form action="<? echo $_SERVER['PHP_SELF']; ?>" method="post">
Name: <input name="name" type="text" maxlength="15">
<input type="submit" name="Submit" value="Submit">
</form>
<?
}
?>
<hr>
<div align="center">PHP Webhosting at <a href="http://www.webune.com">www.webune.com</a></div>

Please remember that you will need PHP for this script to work, if you dont' have PHP on your wesbite, we can help you. or you can visit www.webune.com and signup with PHP hosting with them. we always recommend webune.com because they have excellent service and are always willing to help


Leave Your Comments     [ dejar commentarios ]
  * Name     [nombre]

  * eMail (will not be published)     [coreo electronico]

* Enter Your Reply or Comments:    [commentarios]


Add Picture To Comments         [incluir foto]
YES NO             upload
Receive Replies on my Comments (An email will be sent to you when someone replies to your comments)

     

Comments and replies About How To Count And Break A Word Into An Array In Php Tutorial Guide




:: 1 :: #20527 - Reply By Chuck On Sun Sep 16, 2007 2:36 pm
the colors on this site are killing my eyes..