我在cakephp控制器中执行一个动作 ,它将report_id作为参数,将选定的字段作为数组使用。如何在Cakephp中使用不相等的运算符
我想比较包含已经存在的属性ids的数组与数组我所收到的动作帖子..如果该特定的属性ID如果不存在于收到的数组然后我试图删除在报表中输入.. 我不知道如何在这种情况下使用NOt等于操作符。请帮我.......
function updateReport($report_id){
$attribute_ids=$this->params['form']['attr'];
$comma_separated = explode(",", $attribute_ids);
$count=count($comma_separated);
//$comma_separated contains 200,203
$exists=$this->Report->find('all',array('conditions'=>array('Report.report_id'=>$report_id)));
//$exists contains the attributes as 200 , 201, 203
foreach($exists as $exist){
for($i=0;$i<$count;$i++){
if($exist['Report']['attribute_id']==$comma_separated[$i]){
echo "not in array $comma_separated ".$exist['Report']['attribute_id'];echo " ";
}
}
}
}