Cakephp &;燃气轮机;没有被解码
我有一个cakephp高级搜索表单Cakephp &;燃气轮机;没有被解码,cakephp,get,urldecode,Cakephp,Get,Urldecode,我有一个cakephp高级搜索表单 发送字段、运算符和值数组等参数 总之,我有一个像这样的数组 $fields = array('name','age','class'); $operators = array('==','>=','>'); // > = > $values = array('alex','21','3'); 我想从这3个数组中创建一个数组,如下所示 if($operators[$i] == "=="){ $conditi
发送字段、运算符和值数组等参数 总之,我有一个像这样的数组
$fields = array('name','age','class');
$operators = array('==','>=','>'); // > = >
$values = array('alex','21','3');
我想从这3个数组中创建一个数组,如下所示
if($operators[$i] == "=="){
$conditions[$fields[$i]]=$values[$i];
}elseif($operators[$i] == "LIKE"){
$conditions[$fields[$i]." LIKE"] = "%".$values[$i]."%";
}else{
//having problem here with urldecode.
$conditions[$fields[$i]." ".urldecode($operators[$i])] = $values[$i];
}
我期望age>=
,但它给出了age=
如何解决此问题使用
htmlspecialchars\u decode()
函数而不是urldecode()
嗨,urldecode!=html#u实体#u解码请使用此“<;”for less than and grater than“>;尝试使用htmlspecialchars_解码($operators[$i]))您应该改用CakeDC seach插件()。然后您将实际使用一个包含所有内容的高级搜索,因此您只需要一行配置。将它与查询字符串一起使用也可以通过设计解决编码问题。