PHP: how to split a string with a delimiter -


I have this string that I would like to divide. I should start with this string 1060 and retain the string when I use preg_split (), it removes the string.

My code is:

  $ array = preg_split ("/ 1060 [\ s] * *" / $, $ str);   

Positive style:

  $ array = preg_split ("/ (? = 1060 \ s) /", $ str) div class = "post-text" itemprop = "text"> 

;

(? = 1060 \ s) is a positive form - it claims to have regex ( 1060 \ s ) in it Can be matched, but it does not match. Therefore, it will match an empty string before the match and will correctly divide the text.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -