I would need to get the text between certain strings with preg_match_all. I’ve tried using alternation, but I’m not getting the right info out. What I need is to get the randomtext between weekday-strings. From Friday it should go to the end of the text.
My data is as follows:
Monday 1.1.
randomtext
randomtext
Tuesday 2.1.
randomtext
randomtext
Wednesday 3.1
randomtext
randomtext
Thusday 4.1.
randomtext
randomtext
randomtext
Friday 5.1
randomtext
randomtext
What I have now is this, but it only captures the stuff after Monday, when it should stop to Tuesday and then do it again:
/(Monday|Tuesday|Wednesday|Thursday|Friday)([\s\S]+)/
Any ideas?
You can use
preg_split().Outputs