如何在php中转换此字符串,例如
$str = 'Hello world "some text"'
到
'Hello world «some text»'
答案 0 :(得分:0)
<?php
$str = 'Hello world "some text"';
$regex = '/"(.*?)"/';
$subst = '«$1»';
$result = preg_replace($regex, $subst, $str);
echo $result;
?>