PHP Classes

Little update

Recommend this page to a friend!

      PHP Youtube Embed class  >  All threads  >  Little update  >  (Un) Subscribe thread alerts  
Subject:Little update
Summary:Amended your embed function
Messages:2
Author:Rad Paluszak
Date:2013-11-17 21:48:42
Update:2013-12-22 23:25:00
 

  1. Little update   Reply   Report abuse  
Picture of Rad Paluszak Rad Paluszak - 2013-11-17 21:48:42
As I did not notice you had a GitHub repo to make a pull request, I dropped your code to my GitHub:
github.com/grrinch/php-classes/tree ...

I made a little change in your _embed() function, changing preg_replace to PHP's native functions. I do not rely on preg_replace that much, as YT has many variations of the link.
My version takes any YT link, converts the query string to an array and takes the "v" parameter into the iframe html source.

Obviously, a check making sure it actually is a YT link schould be in place, but I might update it later if you're OK with the code being in my repo.

  2. Re: Little update   Reply   Report abuse  
Picture of Juan Chaves Juan Chaves - 2013-12-22 23:25:00 - In reply to message 1 from Rad Paluszak
Hi Rad,

Sorry for taking so long to reply. Thank you for your input.
I am a real enthusiastic of open code and very much in favour of the input of all people sharing this philosophy.
Your code looks fine to me. Any further suggestions are welcome.

Best regards,
Juan