core/web/jsonld/BaseThing.php
private function removeEmptyValues(array $haystack)
    {
        foreach ($haystack as $key => $value) {
            if (is_array($value)) {
                $haystack[$key] = $this->removeEmptyValues($value);
            }
            // remove empty values value value is NULL or an empty string ''
            if ($value === null || $value == '') {
                unset($haystack[$key]);
            }
        }
        
        return $haystack;
    }
private function removeEmptyValues(array $haystack)
    {
        foreach ($haystack as $key => $value) {
            if (is_array($value)) {
                $haystack[$key] = $this->removeEmptyValues($value);
            }
            // remove empty values value value is NULL or an empty string ''
            if ($value === null || $value == '') {
                unset($haystack[$key]);
            }
        }
        
        return $haystack;
    }
private function removeEmptyValues ( array $ haystack ) { foreach ( $ haystack as $ key => $ value ) { if ( is_array ( $ value ) ) { $ haystack [ $ key ] = $ this -> removeEmptyValues ( $ value ) ; } // remove empty values value value is NULL or an empty string '' if ( $ value === null || $ value == '' ) { unset ( $ haystack [ $ key ] ) ; } } return $ haystack ; }
Cleanup array from null values.

@param array $haystack
@return array
Cleanup array from null values .