php代理

有些网上接口请求需要用代理

php代码

<?php
header('Access-Control-Allow-Origin:*');
$url=$_POST['urlString'];
$res = file_get_contents($url);
echo $res;
?>

地址:     http://xzqyun.top/interface/searchmusicheader.php

示例代码 

            $.post(
                "http://xzqyun.top/interface/searchmusicheader.php",
                {
                    urlString:'网址'
                },
                function(result){
                    console.log(result);
                }
            );
原文地址:https://www.cnblogs.com/xzqyun/p/9754549.html