Hello,
I’m looking for a way to parse html code for validation by using php. The html code will be like this:
<object height="81" width="100%">
<param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F12483908" />
<param name="allowscriptaccess" value="always" />
<embed src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F12483908" allowscriptaccess="always" type="application/x-shockwave-flash" height="81" width="100%">
</embed></object>
Anyone had some experience with this?
Thanks!
Parse for what exactly?
Are you checking specific attributes? or the whole object/embed?
I would like to parse the whole object.
Looks like xhtml…maybe you can try simplexml?
I don’t think that simplexml would work, this is normally for XML , never saw it with xhtml.
Yaeko said
Anyone had some experience with this?
Yes.
Yaeko said
I would like to parse the whole object.
There’s no point in parsing the whole object. Which information from the object do you want to extract for validation?
Where’s the input coming from?
Where’s it going to?
Yaeko said
I don’t think that simplexml would work, this is normally for XML , never saw it with xhtml.
PHP DOMDocument will work with HTML .
You’ll need to explain both the context of your problem and the use case, otherwise we are unable to offer any useful advice.
