两种设置php载入页面时编码的方法

yipeiwu_com5年前PHP代码库

php载入页面时设置页面编码的两种方法

1:输出meta标签:

1、在php mvc的控制器里面或php页面echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
2、在php页面或html页面<meta http-equiv="content-type" content="text/html; charset=utf-8">

2:使用header函数

在控制器或页面里面header("content-type:text/html; charset=utf-8");

相关文章

Zend Framework上传文件重命名的实现方法

本文实例讲述了Zend Framework上传文件重命名的实现方法。分享给大家供大家参考,具体如下: 1. Zend Framework文件上传重命名 //实例化文件上专类 $fNa...

php根据某字段对多维数组进行排序的方法

本文实例讲述了php根据某字段对多维数组进行排序的方法。分享给大家供大家参考。具体分析如下: 根据某字段对多维数组进行排序,在看到array_multisort方法的作用时突然想到,可以...

PHP中foreach循环中使用引用要注意的地方

复制代码 代码如下: foreach ($array as &$row) { $row = explode('/', $row); } foreach ($array as $row)...

解析php中用PHPMailer来发送邮件的示例(126.com的例子)

<?phprequire_once('../class.phpmailer.php');$mail= new PHPMailer();$body= "我终于发送邮件成功了!呵呵!g...

php中的登陆login

login <?php require "../include/DBClass.php"; $username=$_POST['UserName']; $password...