Skip to content Skip to sidebar Skip to footer

How To Convert My Htaccess Code To Php Header

I have these lines of code in my .htaccess. My problem is is this line of code is in my .htaccess i want to put it in my php. I want to do is convert it to php header does anyone

Solution 1:

Did you even try to implement that yourself or read at http://php.net/manual/en/function.header.php?

Write those lines before the first output of the file.Should do the job (although untested):

<?php// ...
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: origin, x-requested-with, content-type');
header('Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS');
?>

Post a Comment for "How To Convert My Htaccess Code To Php Header"