I'm trying to get some comment lines out of our database, they are stored as a string, separated by '\n'. Unfortunately in some of the comments contain texts - also with '\n', and I don't get them separated accordingly.
An example comment looks like:
27.11.2012 13:19 (MB): test123
27.11.2012 13:20 (MB): test456
27.11.2012 13:21 (JA): test789
lalala
lululu
27.11.2012 13:22 (JA): test10
Now I tried so separate them using a reg exp and preg_split():
#(\d{2}\.\d{2}\.20[0123]{2} \d{2}:\d{2} \([A-Z]{2,3}\): .*)#
(PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE)
but I get
Array
(
[0] => 27.11.2012 13:19 (MB): test123
[1] =>
[2] => 27.11.2012 13:20 (MB): test456
[3] =>
[4] => 27.11.2012 13:21 (JA): test789
[5] =>
lalala
lululu
[6] => 27.11.2012 13:22 (JA): test10
)
How do I get them combined?