I’m horrible at reg-exp’s, so I need a little help getting it right.
I got a PHP-variable containing HTML-code created from a PDF. The pages are separate with a comment in the following style:
<!-- Page 1 -->
What I need is to split the content on each of these comment so I can separate the pages from eachother. I tried using just explode('<!-- Page', $content), but that leaves the rest of the tag on the start of the next page so obviously it’s not a good enough solution.
So what I need help with is finding a reg-exp that will split on <!-- Page X --> where the X can be any number. Anyone able to help me out?
This seems to work just fine;
Output:
Hope that helps.