Reply to Re: is_blank()?

Your name:

Reply:


Posted by Rami Elomaa on 05/11/07 21:06

Toby A Inkster kirjoitti:
> Rami Elomaa wrote:
>
>> preg_match('#^ +$#', $var)
>
> As I read the question, preg_match('#^ *$#', $var) might be better.

Okay, my bad. I thought "nothing but spaces" as "at least one space" but
I suppose no spaces at all might also be included in the case, in which
case the * is better than + like you said.

> If tabs and other whitespace characters are to be allowed, then
> preg_match('#^\s*$#', $var) even better!

Yes, that would be the best choice. It's good you mentioned this as
well, perhaps the OP needs to concider this too. :)

--
Rami.Elomaa@gmail.com

"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация