Set the domain name allowed to access:
1. Allow access to all domain names
2. Allow access to the specified domain name
header( 'Access-Control-Allow-Origin:http://a.test.com' );
Set the request mode for access:
1. One or more
Then set other parameters as needed.
The above is the details of setting the response header through the header function to solve the cross domain problem of PHP. If you have anything to add, you can contact Xiaobian. Thank you for your support for developeppaer.