我怎樣才能得到一個雙引號的句子,其中有一個點必須拆分?
實例文檔是這樣的:
如何分割文本以匹配雙引號加尾隨文本到點?
「國際象棋可以幫助我們克服困難和痛苦,」 Unnikrishnan說,以我的皇后。 「在棋盤上,你正在戰鬥。因爲我們也在與日常生活中的艱辛搏鬥。「他說。
我想輸出是這樣的:
Array
(
[0] =>"Chess helps us overcome difficulties and sufferings," said Unnikrishnan, taking my queen.
[1] =>"On a chess board you are fighting. as we are also fighting the hardships in our daily life," he said.
)
我的代碼仍然用點爆炸。
function sample($string)
{
$data=array();
$break=explode(".", $string);
array_push($data, $break);
print_r($data);
}
我仍然困惑分體式兩種分隔符關於雙引號和點。因爲在雙引號內有一個包含點分隔符的句子。
完美的解決方案! – Akintunde007
不錯..但是,我們如何在PHP中打印雙引號? – Rachmad
哦..我知道我的問題,只需編輯.htacces並添加特殊字符'AddDefaultCharset UTF-8 AddCharset UTF-8 .php',謝謝@mickmackusa – Rachmad