$style) { $new = ''; foreach ($style as $property => $value) { if ( '' === $value ) { $new .= "$property ;"; } else { $new .= " $property: $value;"; } } $output .= "$selector { $new }"; } return $output; } }