- 
      
 - 
        
Save malkafly/27aac07501283c153a275f2be5013cc7 to your computer and use it in GitHub Desktop.  
    Get youtube Channel ID by channel url
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| function get_youtube_channel_ID($url){ | |
| $html = file_get_contents($url); | |
| preg_match("'<meta itemprop=\"channelId\" content=\"(.*?)\"'si", $html, $match); | |
| if($match && $match[1]); | |
| return $match[1]; | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment