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
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
Post Description: how to count and break a word into an array in php tutorial guide
POST# 420
Posted On: Fri Feb 29, 2008 12:01 pm
web hosting
Topic: 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



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

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload
     
  1. Warning: Mysql_fetch_array(): Supplied Argument Is Not A Valid MySQL Result
  2. Simple Array Example Learn PHP Programming Creating Arrays Learn Tutorial
  3. How To Create Make PHP Forms Using Form Arrays Tutorial
  4. How To Count And Break A Word Into An Array In Php Tutorial Guide
  5. How To Display Array Contents
  6. PHP Using For Loop To Display The Contents Of An Array
  7. How To Count Array Values Php Counting Arrays Holds Variables Script
  8. How To Use For Loop In Php Using Array Tutorial Sample Script
  9. Count And Display Words In A String Into Array Php Sentence Word
  10. How To Make Array Variable Global In PHP Function
  11. How To Count Elements In An Array Find How Many Values Arrays
  12. How To Check If Array Is Empty Or False Value
  13. How To Display Array Elements With Loop Get Show Array Values In PHP Tutorial
  14. How To Display Array Elements With FOR Loop
  15. Php Form Using Array For Field Name Template User Information
  16. Getting Array Elements Values With While Loop Show Display
  17. Display Array Elements Values With Loop
  18. How To Index Arrays And Show All The Elements And Values Of Array
  19. Php Show Values Array
  20. Php Html Display Array
  21. Making An Array From A Mysql Query