Whitespace is Evil
Posted by Nessa | Posted in code,php | 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;
Related posts:














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!