public function array_filter($inputArray, $model)
    {
        $outputArray = array();
        foreach ($inputArray as $key => $value) {
            // Null and empty string are skipped
            if (is_null($value) || $value === '') {
                continue;
            }
            // Maybe do a check on multiOptions for checkboxes etc. to disable some 0 values $model->get($key, 'multiOptions');
            if ($value == '0' && $options = $model->get($key, 'multiOptions')) {
                if (count($options) == 2) {
                    // Probably a checkbox (multi flexi in limesurvey)
                    continue;
                }
            }
            $outputArray[$key] = $value;
        }
        return $outputArray;
    }
public function array_filter($inputArray, $model)
    {
        $outputArray = array();
        foreach ($inputArray as $key => $value) {
            // Null and empty string are skipped
            if (is_null($value) || $value === '') {
                continue;
            }
            // Maybe do a check on multiOptions for checkboxes etc. to disable some 0 values $model->get($key, 'multiOptions');
            if ($value == '0' && $options = $model->get($key, 'multiOptions')) {
                if (count($options) == 2) {
                    // Probably a checkbox (multi flexi in limesurvey)
                    continue;
                }
            }
            $outputArray[$key] = $value;
        }
        return $outputArray;
    }
public function array_filter ( $ inputArray , $ model ) { $ outputArray = array ( ) ; foreach ( $ inputArray as $ key => $ value ) { // Null and empty string are skipped if ( is_null ( $ value ) || $ value === '' ) { continue ; } // Maybe do a check on multiOptions for checkboxes etc. to disable some 0 values $model->get($key, 'multiOptions'); if ( $ value == '0' && $ options = $ model -> get ( $ key , 'multiOptions' ) ) { if ( count ( $ options ) == 2 ) { // Probably a checkbox (multi flexi in limesurvey) continue ; } } $ outputArray [ $ key ] = $ value ; } return $ outputArray ; }
Strip elements from the array that are considered empty

Empty is NULL or empty string, values of 0 are NOT empty unless they are a checkbox

@param type $inputArray
@param type $model
@return boolean
Strip elements from the array that are considered empty