php可以用css样式吗?
用 PHP文件引入css样式
html:
<link rel="stylesheet" type="text/css" href="http://HdhCmsTestmysite测试数据/path/?index.css,common.css">
php:
$filename = $_GET;
foreach($filename as $key => $value){
$filenameArr = $key;
}
$filenameArr = explode(',' , $filenameArr);
$files = array();
if(count($filenameArr) > 1){
foreach($filenameArr as $key => $value){
$arr = explode('_', $value);
$files[] = $arr[0].'.'.$arr[1];
}
}else{
$arr = explode('_', $filenameArr[0]);
$files[] = $arr[0].'.'.$arr[1];
}
$context = stream_context_create(
array(
"http" => array(
"header" => "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36",
)
)
);
//css声明
header('Content-type: text/css');
$content = '';
foreach($files as $key => $value){
$content .= iconv("utf-8", "gb2312",file_get_contents('http://HdhCmsTestmysite测试数据/path/to/' . $value, false, $context));
}
echo $content; 更多PHP相关知识,请访问PHP中文网!
以上就是php可以用css样式吗的详细内容,更多请关注Gxl网其它相关文章!
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did58393