Holen Sie sich Youtube Video-ID aus html-code mit PHP

Ich will nur-youtube-video-ID aus dem html-code

Aussehen (oder mehrere) Objekt/embed-code für youtube-video

//html-Code aus Datenbank

    <p>loremm ipsum dolor sit amet enot
    <a href="link" attribute=""blah blah blah">anchor link</a>
    </p>

    <object width="425" height="344">
        <param name="movie" value="http://www.youtube.com/v/Ou5eVl5eqtg&hl=es_ES&fs=1&"></param>
        <param name="allowFullScreen" value="true"></param>
        <param name="allowscriptaccess" value="always"></param>
        <embed src="http://www.youtube.com/v/Ou5eVl5eqtg&hl=es_ES&fs=1&"
    type="application/x-shockwave-flash"
    allowscriptaccess="always"
    allowfullscreen="true"
    width="425"
    height="344">
    </embed>
        </object>

    <image src="path/to/image.ext" >
    <p>lorem ipsum dolor sit amet... blah</p>
    <p>lorem ipsum dolor sit amet... blah</p>

    <object width="425" height="344">
        <param name="movie" value="http://www.youtube.com/v/Ou5eVl5eqtg&hl=es_ES&fs=1&"></param>
        <param name="allowFullScreen" value="true"></param>
        <param name="allowscriptaccess" value="always"></param>
        <embed src="http://www.youtube.com/v/Ou5eVl5eqtg&hl=es_ES&fs=1&"
    type="application/x-shockwave-flash"
    allowscriptaccess="always"
    allowfullscreen="true"
    width="425"
    height="344">
    </embed>
        </object>
<p>blah</p>
blah<br/>
blah<br/>
blah<br/>
... und deine Frage ist? Haben Sie produzieren keine nicht-funktionierenden code noch?
Ich gründete diesen code auf internet preg_match('/[\\?\\&]v=([^\\?\\&]+)/',[youtubevidurl], $matches); aber nicht funktioniert in diesem Fall, ich bin nicht versiert auf regex sorry mein Englisch 🙁

InformationsquelleAutor asumaran | 2009-11-20

Schreibe einen Kommentar