1 php
if (strlen($title) && strlen($message) > 3)
Run Code Online (Sandbox Code Playgroud)
如果$ title超过3个字符,则返回true,如果BOTH为,我只希望它返回true.什么是正确的方法?试了一堆.FNYS.
请帮忙.
Dre*_*awn 11
if((strlen($ title)> 3)&&(strlen($ message)> 3))
我确实看到了你的拍摄对象,但它并不经常被支持.一般来说,"if"测试的每个块都是独立的 - 我喜欢添加额外的括号,只是为了让事情更清晰.
所以你的原始测试归结为"if(strlen($ title))"和"if(strlen($ message)> 3)".