title: PhP function for Youtube Embed Video
body: <p>I am trying to preg_match() youtube videos that are stored in a database column.</p>
  
  <p>The database column is named "trailer_url"</p>
  
  <pre><code> &lt;?php
  //$url = '';
  $result = mysql_query("SELECT trailer_url FROM top_sites");
  $storeArray = Array();
  while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
  $storeArray[] =  $row['trailer_url'];  
  }
  //$trailer_url = $_POST['trailerUrl'];
  preg_grep('/[\\?\\&amp;]v=([^\\?\\&amp;]+)/', $storeArray, $matches);
  $id = $matches[1]; ?&gt;
  </code></pre>