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. More of Using PHP for Server Info
  3. Command Line PHP – Part 1
  4. Using PHP to Display Version Info
  5. Command Line PHP: Part 2

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