首页 > 技术文章 > PHP接收跨域请求header 头设置

lixihuan 2018-09-10 15:32 原文

header("Access-Control-Allow-Origin: http://a.com"); // 允许a.com发起的跨域请求
//如果需要设置允许所有域名发起的跨域请求,可以使用通配符 *
header("Access-Control-Allow-Origin: *"); // 允许任意域名发起的跨域请求

 

推荐阅读