RSS Feed Icon The WebDevil - Jeremy Lindblom

WebDevilAZ

The Portfolio & Blog
of Jeremy Lindblom

Latest Posts in Programming Tidbits

PHP Tidbits: trim magic

February 26, 2009 at 8:00 pm

It turns out that the trim() functions of PHP are even more useful than I originally thought. The trim functions ( trim(), ltrim() and rtrim() ) are normally used to trim whitespace from the ends of strings. However, the definition of trim from the PHP Manual states: “Strip whitespace (or other characters) from the beginning and end of a string”. I added emphasis (literally) to the part that says “(or other characters)”. That means we can trim anything from a string. I hope you can see the value of this. Well, I’ll show you a brief example anyway after the fold.

(more…)

Share This Post:
  • Digg
  • del.icio.us
  • Facebook
  • StumbleUpon
  • TwitThis
  • Reddit
  • MySpace
  • LinkedIn
  • Mixx
  • Design Float
  • Slashdot
  • Yahoo! Buzz
  • Sphinn
  • Technorati
  • Google
Category: Programming Tidbits, Web Development
Tags:



Clicky Web Analytics

©2008-2009 Jeremy Cole Lindblom. All rights reserved. Design and development by Jeremy Lindblom.

WebDevilAZ is proudly powered by Wordpress and Panels960. Subscribe to my RSS feed.