设置跨域
header('Content-Type: text/html; charset=utf-8');
header('Access-Control-Allow-Origin: *'); // *代表允许任何网址请求
header('Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE'); // 允许请求的类型
header('Access-Control-Allow-Credentials: true'); // 设置是否允许发送 cookies
header('Access-Control-Allow-Headers: Content-Type, Content-Length, Accept-Encoding, X-Requested-with, Origin'); // 设置允许自定义请求头的字段
php.ini display_errors = On error_reporting(E_ALL && ~E_NOTICE);
set_magic_quotes_runtime() magic quotes,即魔术引号功能,是PHP 5.3及更早版本中用于自动转义双引号、单引号、反斜线和null特殊字符的。 PHP 5.4 弃用 PHP 7.0 移除 该函数被弃用并移除是因为magic quotes这一功能被弃用或移除。
PHP \n 必须双引号
https://github.com/colinlet/PHP-Interview-QA