php - Overlaying text from YouTube API on image thumbnail -


I have set up a script that shows recent video thumbnails from the YouTube playlist using the data API.

I want to grab three letters before the title and overlay on thumbnails, how can I get this information and display it? I can css, I am unsure about how to call it.

The current progress is in the video pod ...

The current PHP code is:

   entry $ as playlist) {$ media = $ playlist-> Children ('http://search.yahoo.com/mrss/'); $ Attrs = $ media- & gt; Group-> Thumbnail [1] - & gt; a quality (); $ Thumbs = $ attrs ['url']; $ Attrs = $ media- & gt; Group-> Player- & gt; Features (); $ Video = $ attrs ['url']; $ Title = substr ($ media-> group-> title, 27); $ Url = $ video; Parse_str (parse_url ($ url, PHP_URL_QUERY), $ my_array_of_vars); $ Vid_Id = $ my_array_of_vars ['v']; $ Thumbnail = '& Lt; Div style = "float: left; cursor: pointer;" & Gt; & Lt; P class = "crop" & gt; & Lt; One class = "videobox different iframe" href = "http://www.youtube.com/embed/ '. $ Vid_Id.' Autoplay = 1 & amp; hd = 1 '& lt; / a & gt; & lt; / p & gt; & lt; / lb; / div & gt;'}; print $ thumbnail;}? & Gt; < / Code>   

  $ title = substr ($ media-> group-> gt; ; Title, 0, 3);   

You can resize this variable and display the first 3 characters of the title:

  echo $ title; < / Code>   

Comments