$test_string = 'this is a "test as" string juventus vs "napoli" is b a bing match';echo convertQuotToChinese($test_string); function convertQuotToChinese($string) { $flag = false; //false显示开始的中文引号,true时显示结束的中文引号 while(false !== ($i = strpos($string, '"'))) { $begin_string = substr($string, 0, $i); $end_string = substr($string, $i+1-strlen($string)); $quot = $flag ? '”' : '“'; $flag = !$flag; $string = $begin_string.$quot.$end_string; } return $string;}