$str = 'yellow green "cheese cake" "chocolate flavour" brown';
$split = explode(' ', $str);
$split[] = '';
$count = count($split);
$result = array();
for($i = 0; $i < $count; $i++) {
if(substr($split[$i], 0, 1) == '"' && substr($split[$i + 1], -1, 1) == '"') {
$result[] = $split[$i] . ' ' . $split[$i + 1];
$i++;
} else {
$result[] = $split[$i];
}
}
array_pop($result);
print_r($result);