skij
asked on
PHP/REGEX: Put matches inside array
Using PHP and REGEX, how can I put the content between the "<!--xContent-->" tags inside of an array?
This:
This:
<!--xContent-->
Hello World
<!--/xContent-->
xyz
<!-- xContent -->
Example
<!--/xContent -->
Blah blah blah
<!-- xContent -->
Hi
<!-- /xContent -->
Should become this:
Array
(
[0] => Hello World
[1] => Example
[2] => Hi
)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Why not simplify your life and convert it to XML formatted file and use php XML related tools to read/write the file as when needed.
Open in new window