blog.knym.net | I'm searching something to change my life.

(Japanese) youtubeのurlからidのみを正規表現で取得したいとき

$htmlの値が’YouTube Preview Image‘や
YouTube Preview Image
のとき。



preg_match_all(‘/youtube\.com\/watch\?v=([a-zA-Z0-9]*)&?(.*?)\[\//i', $html, $youtubematch);
print_r($youtubematch[1][0]);

Related Posts

Write a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

Essentials