function test(){ $a = $this -> request -> param('a'); if($a){ return strlen($a);//如果值是 like 或者 in 后面或多个空格 } return $this -> fetch(); }
test.html <form> <input type="text" value="like" name="a" /> <input type="submit" value="提交" /> </form>