Whitespace is Evil

Posted by Nessa | Posted in , | Posted on December 19, 2007

2

I have this recurring nightmare of PHP apps that don’t trim whitespace when entering info. As a habitual copy and paster, it would be nice if some programmers could tend to my laziness and reluctance to type. Yes, Tony, I’m talking about you. Ever hear of the trim() function? Yea, it’s the Brazilian wax of PHP you inconsiderate bastard.

$text = "some text with extra spaces ";
$trimmed = trim($text);
echo $trimmed;

Share and Enjoy:
  • Digg
  • DZone
  • del.icio.us
  • Technorati
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • Twitter
  • Sphinn
  • Mixx
  • blogmarks
  • Furl
  • Reddit
  • Slashdot
  • RSS

Related posts:

  1. Command Line PHP: Part 3
  2. Using PHP to Perform DNS Lookups
  3. More of Using PHP for Server Info
  4. Catching SoapClient Errors
  5. Using PHP to Extract Image Exif Data

Comments (2)

But then how will you ever paste in your python code snippets? *Shudder*

That’s the thing I hate most about Python. Whitespace should not matter!

Post a comment