title: auto-detect and auto-embed youtube videos. PHP or Javascript?
body: <p>I run a 4chan style imageboard. When users post youtube or soundcloud links, I would like for the board to give a second link which, when clicked, would embed the video. </p>
  
  <p>If I am not mistaken, 4chan uses JS to accomplish this. I have also seen many forum admins using php to do this. I know that wordpress uses php to do this.</p>
  
  <p>If I went with php, I was thinking of going with something based on this:
  <a href="https://www.warpconduit.net/2013/04/13/automatically-embedding-video-using-only-the-url-with-the-help-of-oembed/" rel="nofollow">https://www.warpconduit.net/2013/04/13/automatically-embedding-video-using-only-the-url-with-the-help-of-oembed/</a></p>
  
  <p>For JS I am not entirely sure how to go about it. I would probably use a regex to detect youtube urls and then convert that information to an embed</p>