scripting - PHP validate youtube script -
I have a site that allows YouTube to copy and paste the embedded video script which YouTube provides and uploads it to the database. I want to be able to check that this script is a valid YouTube script and does not have any typed random text. I believe this can be done with a pre-match match, any thoughts?
You can use:
preg_match ('/ ^ & Lt; Object (?? Lt; width_height & gt; width = "[[: num:]] +" height = "[[: num:]] +") & gt; & lt; param name = "movie" Value = (? & Lt; url & gt; "http: \ / \ / www.youtube.com / v \ / [^ & amp; amp;] & amp; hl = [[: alpha:]] {2} & Amp; FS = 1 ") and gt; gt; & lt; param name =" Allow full screen "value =" true "> gt; (& lt; ASA & gt; Permission Copy) "Value =" Always "& gt; & lt; / Param & gt; & lt; Embed src = (? P = url) Type =" app / x-shockwave-flash "(? P = asa) = "always" allowed screen = "co "(? P = width_height)> $ / ', $ yt); But just one It would be better to enter the URL (which is easy to validate and parse), and create it yourself.
Comments
Post a Comment