Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

Tiny Little Word Display

Code Wizard, 12-30-2006

Nothing superbly complex, but this is quite useful. It takes a variable and displays X amount of words from it. Useful on displaying a preview of something from a database, like on a forum for example. Again, nothing complicated, but useful still.

<?
$thing = "Sweet dreams are made of these, who am i to disagree?";
$new = explode(" ", $thing);
echo "$new[0] $new[1] $new[2]";
?>
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions