像这样的示例文档:
"国际象棋帮助我们克服困难和痛苦,"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.
)
Run Code Online (Sandbox Code Playgroud)
我的代码仍然被点破坏.
function sample($string)
{
$data=array();
$break=explode(".", $string);
array_push($data, $break);
print_r($data);
}
Run Code Online (Sandbox Code Playgroud)
关于双引号和点分割两个分隔符,我仍然很困惑.因为在双引号内有一个包含点分隔符的句子.