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

判定长度能不能简单化

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 10:42:12
Original
867 people have browsed it

判定长度能不能简化?

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') 
Copy after login



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

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


------解决方案--------------------
长度是整数!~~用正则估计也差不多想不出更好的办法了就这样吧!~
Related labels:
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template