Home  >  Article  >  Backend Development  >  判定长度能不能简单化

判定长度能不能简单化

WBOY
WBOYOriginal
2016-06-13 13:17:53797browse

判定长度能不能简化?

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->if(mb_strlen($_POST['wage']) > 4 && mb_strlen($_POST['url']) > 12 && mb_strlen($_POST['task'],'utf-8') > 20 && mb_strlen($_POST['task'],'utf-8') 



这样写好像太麻烦. 能不能有更好的写法?

还有, 正则表达式的速度是不是很慢?


------解决方案--------------------
长度是整数!~~用正则估计也差不多想不出更好的办法了就这样吧!~
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn