If I were using youtube for an example,
$link = "http://www.youtube.com/watch?v=hYVVCRqTz1Q"
In the source code of http://www.youtube.com/watch?v=hYVVCRqTz1Q
we can find
<meta property="og:image" content="http://i1.ytimg.com/vi/hYVVCRqTz1Q/hqdefault.jpg?feature=og">
I would like php to use $link
to obtain $thumbnail
where
$thumbnail = "http://i1.ytimg.com/vi/hYVVCRqTz1Q/hqdefault.jpg"
Now match if the URL is a valid Youtube Link by matching it with Pattern.
Youtube Headers
Thumbnail >