Re: string lenght?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



William Stokes wrote:
How can I test whether a string is 1 or 2 digits long?

You can use regular expressions:

preg_match('/^\d{1,2}$/',$str);

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux