715 posts
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Belgium
+1 more
Hy-Studio says

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!

1173 posts
  • Has been part of the Envato Community for over 5 years
  • Located in Australia
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+3 more
Motionreactor says

Parse for what exactly?

Are you checking specific attributes? or the whole object/embed?

715 posts
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Belgium
+1 more
Hy-Studio says

I would like to parse the whole object.

1148 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
fillerspace says

Looks like xhtml…maybe you can try simplexml?

715 posts
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Belgium
+1 more
Hy-Studio says

I don’t think that simplexml would work, this is normally for XML , never saw it with xhtml.

99 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
Lamovo says

Anyone had some experience with this?

Yes.


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?


I don’t think that simplexml would work, this is normally for XML , never saw it with xhtml.

PHP DOMDocument will work with HTML .

1173 posts
  • Has been part of the Envato Community for over 5 years
  • Located in Australia
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+3 more
Motionreactor says

You’ll need to explain both the context of your problem and the use case, otherwise we are unable to offer any useful advice.

by
by
by
by
by
by