用游览器访问直接下载一个MP3 可以参考如下代码:
<?php
$data = file_get_contents('target/XX.PHP?V=1')
file_put_contents('test.mp3', $data, true)
?>
parse_url()
<?php$url = 'http://username:password@hostname/path?arg=value#anchor'
print_r(parse_url($url))
echo parse_url($url, PHP_URL_PATH)
?>
输出
Array
(
[scheme] =>http
[host] =>hostname
[user] =>username
[pass] =>password
[path] =>/path
[query] =>arg=value
[fragment] =>anchor
)
/path
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)