public static function clearTextConcat($value)
    {
        if (is_string($value)) {
            return trim(preg_replace('/\s+/s', ' ', $value));
        }
        if (is_array($value)) {
            $result = [];
            foreach ($value as $val) {
                $result[] = self::clearTextConcat($val);
            }
            return implode(' ', array_filter($result, 'strlen'));
        }
        return null;
    }
public static function clearTextConcat($value)
    {
        if (is_string($value)) {
            return trim(preg_replace('/\s+/s', ' ', $value));
        }
        if (is_array($value)) {
            $result = [];
            foreach ($value as $val) {
                $result[] = self::clearTextConcat($val);
            }
            return implode(' ', array_filter($result, 'strlen'));
        }
        return null;
    }
public static function clearTextConcat ( $ value ) { if ( is_string ( $ value ) ) { return trim ( preg_replace ( '/\s+/s' , ' ' , $ value ) ) ; } if ( is_array ( $ value ) ) { $ result = [ ] ; foreach ( $ value as $ val ) { $ result [ ] = self :: clearTextConcat ( $ val ) ; } return implode ( ' ' , array_filter ( $ result , 'strlen' ) ) ; } return null ; }
Recursive clears all text in array
@param string $value
@return string|NULL
Recursive clears all text in array