长乐王
长乐王

PHP的header()函数常用content-type汇总

//HTML
header('Content-Type:text/html;charset=utf-8');
//CSS
header('Content-type:text/css;charset=utf-8');
//Javascript
header('Content-type:text/javascript;charset=utf-8');
//XML
header('Content-type:application/xml;charset=utf-8');
//JSON
header('Content-type:application/json;charset=utf-8');