getting video ID attribute from youTube url with php

/ Published in: PHP
Save to your folder(s)

taken from comments at above URL

Copy this code and paste it in your HTML
  1. parse_str(parse_url($embedurl,PHP_URL_QUERY), $out);
  2. print_r($out);
  3. echo $out['v']; // return ID of video


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.