php preg match html cross origin

Solutions on MaxInterview for php preg match html cross origin by the best coders in the world

showing results for - "php preg match html cross origin"
Paola
28 Jan 2018
1$origin = $_SERVER['HTTP_ORIGIN'];
2$allowed_domains = [
3    'http://mysite1.com',
4    'https://www.mysite2.com',
5    'http://www.mysite2.com',
6];
7
8if (in_array($origin, $allowed_domains)) {
9    header('Access-Control-Allow-Origin: ' . $origin);
10}
11