[英]Php UTF-8 encode
我的索引
defined("DS") || define("DS", DIRECTORY_SEPARATOR);
defined("ROOT_PATH") || define("ROOT_PATH", realpath(dirname(__FILE__)));
require_once(ROOT_PATH.DS.'classes'.DS.'Helper.php');
$page = 'default';
$uri = $_SERVER['REQUEST_URI'];
if(!empty($uri)){
$first = substr($uri, 0, 1);
if($first == '/') {
$uri = substr($uri, 1);
}
if(!empty($uri)) {
$uri = explode('?', $uri);
$uri = explode('/', $uri[0]);
$page = array_shift($uri);
}
}
$content = array(
'con' => Helper::getContent($page)
);
if(!empty($_GET['ajax'])) {
echo json_encode($content);
} else {
require_once('temp/temp.php');
}
我的课程
class Helper {
public static function getContent($file = null) {
$file = 'content/'.$file.'.php';
if(is_file($file)) {
ob_start();
require_once($file);
return ob_get_clean();
}
}
}
当我显示内容页面涉及的混合字符时,如何做utf-8?
您可以在此处找到带有PHP脚本的文档,以对字符串进行重新编码。 内容是法语博客文章,但脚本是中间页中的简单要点
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.