715 posts
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Belgium
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
Yaeko 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
  • Australia
  • Beta Tester
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 10 000 and 50 000 dollars
Motionreactor says

Parse for what exactly?

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

715 posts
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Belgium
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
Yaeko says

I would like to parse the whole object.

1025 posts
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
  • Exclusive Author
  • Microlancer Beta Tester
  • United States
fillerspace says

Looks like xhtml…maybe you can try simplexml?

715 posts
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Belgium
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
Yaeko says

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

99 posts
  • Bought between 1 and 9 items
  • Referred between 1 and 9 users
  • Belgium
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Has been a member for 3-4 years
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
  • Australia
  • Beta Tester
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 10 000 and 50 000 dollars
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