【发布时间】:2017-10-20 07:51:32
【问题描述】:
我怎样才能得到一个双引号中的句子,其中有一个必须拆分的点?
像这样的示例文档:
“国际象棋帮助我们克服困难和痛苦,”乌尼克里希南说,带着我的王后。 “在棋盘上,你正在战斗。因为我们也在与日常生活中的艰辛作斗争。”他说。
我想得到这样的输出:
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);
}
我仍然对拆分关于双引号和点的两个分隔符感到困惑。因为在双引号里面有一个包含点分隔符的句子。
【问题讨论】:
标签: php regex unicode preg-split