【发布时间】:2017-11-01 21:05:03
【问题描述】:
我有一个 100 万个字符的文本行,我有 PART2 就在文本行的中间,也就是 500 个字符 ' PART2 ' 之前的 s 个字符和 ' PART2 ' 之后的 500 个字符 我的问题是我如何从' PART2 ' 的位置开始 str_split 。在文本行中 例子
`5_hundred_thusands_text_charactersPART2fivehundredthusandstextcharactersagain`
str_split 之后的结果输出应该从“PART2”开始 'fivehundre','dthusandte','xtcharacte' 这些是我的代码:
$txt = "5_hundred_thusands_text_charactersPART2fivehundredthusandstextcharactersagain";
if(preg_match('/(START)/i', $txt)) {
#start from there
$see = str_split($txt, 10);
echo " ','$see";
}
我使用这段代码的结果只是从一开始我真的可以在 php 中实现吗?感谢您阅读并影响我的解决方案
【问题讨论】: