How can I do a multiline preg_match?
I have an xml file like this
<?xml version="1.0" encoding="ISO-8859-1"?>
<server_list>
<server>
<name>server.host.com</name>
<ip>127.0.0.1</ip>
<username>username</username>
<password>password</password>
</server>
<server>
<name>server2.hos.com</name>
<ip>255.255.255.255</ip>
<username>username</useranme>
<password>password</password>
</server>
</server_list>
Now, I want to match everything between the <server_list> and the </server_list> using preg_match, however this returns nothing '/<server_list>(.)<\/server_list>/' I am guessing that . does not include new lines I have also tried [.\n] but to no avail.
I know I can use explode far more easily for this simple case, but that would not be so good for handling more complex situations ie <server name="server.host.com" ip="127.0.0.1">)
I do not have the XML parser functions and cannot add these to the system.
Any help would be appreciated
Thanks