[ create a new paste ] login | about

Link: http://codepad.org/Kyz38Pbu    [ raw code | output | fork ]

PHP, pasted on Jul 30:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

$string = "
0001

a
b
c
d
e

0002

f
g
h
i
j
";

print_r(preg_split("/(?=\d{4})/", $string));


Output:
Array
(
    [0] => 

    [1] => 0001

a
b
c
d
e


    [2] => 0002

f
g
h
i
j

)


Create a new paste based on this one


Comments: