我目前有这个代码:
if (strlen(trim($username) < 4)) {
$error='Username should be between 4 and 10 characters.';
}
if (strlen(trim($username) > 10)) {
$error='Username should be between 4 and 10 characters.';
}
我希望将其简化为一个更简单的语句,如下所示(但这显然行不通):
if (strlen(trim($username) < 4 >10))... // parse error