php如何设置允许跨域请求 其他教程 4月16日 编辑 管理员 取消关注 关注 私信 php如何设置允许跨域请求? 在php文件头部加入 header(“Access-Control-Allow-Origin: *”); 如果想设置只允许某个网站通过的话可以这样设置 header(“Access-Control-Allow-Origin: http://test.com”); // 允许test.com发起的跨域请求,其他的都不通过 给TA打赏 共{{data.count}}人 人已打赏