Skip to content

Instantly share code, notes, and snippets.

View khiconit's full-sized avatar

Daniel Truong khiconit

View GitHub Profile
<?php
function get_mp3($url) {
$arg = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)';
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $arg);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $arg);
curl_setopt($ch, CURLOPT_URL, $url);