这是我的原字符串: -用什么分裂我的字符串'preg_split`
$data = "<br />
Q.156) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow: <br />
Breaking up :- Number of Employees working in Different Departments of an Organisation, the Number of Males and the Number of Employees Who Recently Got Promoted in Each Department <br />
<br />
Q.157) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow: <br />
Breaking up :- Number of Employees working in Different Departments of an Organisation, the Number of Males and the Number of Employees Who Recently Got Promoted in Each Department <br />
<br />
Q.158) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow: <br />
Breaking up :- Number of Employees working in Different Departments of an Organisation, the Number of Males and the Number of Employees Who Recently Got Promoted in Each Department <br />
<br />
Q.159) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow: <br />
Breaking up :- Number of Employees working in Different Departments of an Organisation, the Number of Males and the Number of Employees Who Recently Got Promoted in Each Department <br />
<br />
Q.160) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow: <br />
Breaking up :- Number of Employees working in Different Departments of an Organisation, the Number of Males and the Number of Employees Who Recently Got Promoted in Each Department <br />
<br />
Q.161) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow: <br />
Breaking up :- Number of Employees working in Different Departments of an Organisation, the Number of Males and the Number of Employees Who Recently Got Promoted in Each Department <br />
<br />
Q.162) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow: <br />
Breaking up :- Number of Employees working in Different Departments of an Organisation, the Number of Males and the Number of Employees Who Recently Got Promoted in Each Department <br />
";
我想我的字符串分割为数组中此格式
Array (
[0] => Q.156) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow:
Breaking up :- Number of Employees working in Different Departments of an Organisation, the Number of Males and the Number of Employees Who Recently Got Promoted in Each Department
[1] => Q.157) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow:
Breaking up :- Number of Employees working in Different Departments of an Organisation, the Number of Males and the Number of Employees Who Recently Got Promoted in Each Department
[2] => Q.158) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow:
Breaking up :- Number of Employees working in Different Departments of an Organisation, the Number of Males and the Number of Employees Who Recently Got Promoted in Each Department
[3] => Q.159) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow:
Breaking up :- Number of Employees working in Different Departments of an Organisation, the Number of Males and the Number of Employees Who Recently Got Promoted in Each Department
[4] => Q.160) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow:
Breaking up :- Number of Employees working in Different Departments of an Organisation, the Number of Males and the Number of Employees Who Recently Got Promoted in Each Department
[5] => Q.161) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow:
Breaking up :- Number of Employees working in Different Departments of an Organisation, the Number of Males and the Number of Employees Who Recently Got Promoted in Each Department
[6] => Q.162) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow:
Breaking up :- Number of Employees working in Different Departments of an Organisation, the Number of Males and the Number of Employees Who Recently Got Promoted in Each Department
)
我知道我可以使用preg_split('/[Q[.]]+/', $data)
但是我在正则表达式方面有点弱。 请帮我我的正则表达式合并相应..
不,我必须保持中断标记。 –
@ chris85伟大的工作....但我需要像'Q.1234)一样的通用',因为你看到之后有整数。 (“/ d”)..现在会是最终的正则表达式 –