title: Youtube id from database row
body: <p>Ive been trying to extract the youtube id from the youtube url for long time and finally i found this code from another thread.</p>
  
  <pre><code>&lt;?
  
      preg_match(
          '/[\\?\\&amp;]v=([^\\?\\&amp;]+)/',
          'http://www.youtube.com/watch?v=0mVck88W01I',
          $matches
      );
  
  
  ?&gt;
  </code></pre>
  
  <p>and the id is will print when i write <code>echo $matches[1];</code> as it should</p>
  
  <p>The problem is i want it to find the link from <code>$row[link]</code> in my database and when i replace the url with <code>echo "$row[link]";</code> it do not work. it only works with an youtube url?</p>
  
  <p>and im 100% the <code>$row[link]</code> since im using it in other parts of the script and the link is being printed</p>
  
  <p>My question is how can i make it print the youtube id for each row in my database?</p>