如何检查
PHP字符串是否包含任何空格?我想检查是否有空格在那里,然后回显一个错误消息如果为true
- if(strlen($username) == whitespace ){
- echo "<center>Your username must not contain any whitespace</center>";
- if ( preg_match('/\s/',$username) ) ....