<?php
$text = <<<EOT
<br /> 1 <br /> 2 <br /> 3 <br /> 4 <br /> 5 <br /> 6
<br /> 7 <br /> 8 <br /> 9 <br /> 10 <br /> 11 <br /> 12
<br /> 13 <br /> 14 <br /> 15 <br /> 16 <br /> 17 <br /> 18
EOT;
?>
我想要分割$ text和结果
$txt="
<br /> 1 <br /> 2 <br /> 3 <br /> 4 <br /> 5 ";
我想要<br />
1,2,3,4是随机字符串 请帮帮我
答案 0 :(得分:1)
试试这个:
$arr = array_splice(explode('<br />',$text),0,6);
$result = implode('<br />',$arr);