如何在某个索引后停止爆炸功能。例如
<?php
$test="The novel Prognosis Negative by Art Vandelay expresses protest against many different things. The story covers a great deal of time and takes the reader through many different places and events, as the author uses several different techniques to really make the reader think. By using a certain type of narrative structure, Vandelay is able to grab the reader’s attention and make the piece much more effective and meaningful, showing how everything happened";
$result=explode(" ",$test);
print_r($result);
?>
如果只想使用前 10 个元素怎么办 ($result[10]) 填充 10 个元素后如何停止分解功能。
一种方法是首先将字符串修剪到前 10 个空格(“”)
还有其他方法吗,我不想在任何地方限制后存储剩余的元素(如使用正限制参数所做的那样)?