Page 1 of 1

string parsing issue

Posted: Tue Oct 31, 2006 1:33 am
by itsmani1

Code: Select all

HTTP/1.1 200 OK 
Connection: keep-alive Date: Tue, 31 Oct 2006 07:26:51 
<?xml version="1.0" encoding="utf-8"?>
<ROOT>
	<DATA xmlns:sql="urn:schemas-microsoft-com:xml-sql">
		<row THISID="1987" THISNAME="Alliance Theatre" ST="GA" />
		<row THISID="2963" THISNAME="Walnut Street Theatre" ST="PA" />
	</DATA>
</ROOT>
Assume the above text is in a string and i wanted to fetch text between "<?xml version="1.0" encoding="utf-8"?>" and "</ROOT>", who can i do so?

any php function?

Posted: Tue Oct 31, 2006 2:53 am
by CoderGoblin
Suggest looking through working with regex/RegExp/regular expressions and explanations of how they work:
http://forums.devnetwork.net/viewtopic.php?t=29292
http://forums.devnetwork.net/viewtopic.php?t=29115
http://forums.devnetwork.net/viewtopic.php?t=29318
http://forums.devnetwork.net/viewtopic.php?t=29010
http://forums.devnetwork.net/viewtopic.php?t=25714

Or you could try the XML facilities within PHP if you know the data is well formed... XML Parser Functions