array_filter with callback?

Status
This content is read-only, or is not open for further replies.

Robert9

Guest
offline
Code:

Code:
            $newCustomFields = $this->filter('custom_fields', 'array');
            $newCustomFields = array_filter($newCustomFields);

I would like to make a check on " ";

Code:

Code:
    private function checkElement($var)
    {
       return trim($var) != '';
    }


How can I call checkElement?

Code:

$newCustomFields = array_filter($newCustomFields,'checkElement');

does not work

Any idea?

Continue reading...
 
Liked by:
Status
This content is read-only, or is not open for further replies.
Top Bottom