- array_filter: documentation ( source)
- json_encode: documentation ( source)
<?php
class Zend_Json {
public static function encode($var) {
return json_encode($var);
}
}
$brand = null;
$category = null;
$type = null;
///////////////////////////////////////////////////////
$atLeastOneIsSelected = array();
$atLeastOneIsSelected = array_filter(array($brand, $category, $type));
if (sizeof ($atLeastOneIsSelected) < 1) {
echo \Zend_Json::encode(array('success' => false));
exit;
}