如果内容有空格,如何添加单引号或双引号

I try to make dynamic CSS using PHP.

Example on font-family

$one = 'Times New Roman, Times, serif';
$two = 'Lucida Sans Unicode, Lucida Grande, sans-serif';

On style.php

body { font-family:<?php echo $two; ?>; }

Here I want to add a single quote or double quote to the Lucida Sans Unicode, Lucida Grande

So the ouput should be

body { font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif; }

Let me know how to replace the font with a quote

A bit more functional :-)

function put_quotes ($name) {
  $name = trim($name);
  return strpos($name, ' ') ? '"' . $name . '"' : $name;
}

$css = implode(', ', array_map('put_quotes', explode(',', $one)));

Could you not just do:

body { font-family:"<?php echo strpos(' ', $two) !== false ? '"'.$two.'"' : $two; ?>"; }
$two = '"Lucida Sans Unicode", "Lucida Grande", sans-serif';

then

body { font-family:<?php echo $two; ?>; }
$two = 'Lucida Sans Unicode, Lucida Grande, sans-serif';
$aux = explode(',',$two);
foreach($aux as &$f){
    $f = trim($f);
    if(strpos($f,' ') !== FALSE)
        $f = '"' . $f . '"';
}

echo implode(', ',$aux); // "Lucida Sans Unicode", "Lucida Grande", sans-serif

Edit:
I didn't think of it, but indeed, adding the quotes to the variable $two (where needed) might do the trick... What happened to my KISS?...

$two_a = explode(",", $two);
foreach($two_a as $str) {
    $str = "'".$str."'";
}
$two = implode(",", $two_a);