Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用瑞典语(PHP/Wordpress)写出工作日名称时出现编码错误_Php_Wordpress_Strtotime_Strftime_Setlocale - Fatal编程技术网

用瑞典语(PHP/Wordpress)写出工作日名称时出现编码错误

用瑞典语(PHP/Wordpress)写出工作日名称时出现编码错误,php,wordpress,strtotime,strftime,setlocale,Php,Wordpress,Strtotime,Strftime,Setlocale,知道我为什么会在这段代码中出现编码错误吗 $date_pre = get_field("date"); $date_s = date("j/n", strtotime($date_pre)); setlocale(LC_TIME,'sv_SE'); $month = strtolower(strftime("%B", strtotime($date_pre))); $date_l = strftime("%A %e " . $month, strtotime($date_pre)); $da

知道我为什么会在这段代码中出现编码错误吗

$date_pre = get_field("date");
$date_s = date("j/n", strtotime($date_pre));

setlocale(LC_TIME,'sv_SE');
$month = strtolower(strftime("%B", strtotime($date_pre)));
$date_l = strftime("%A %e " . $month, strtotime($date_pre));

$date\u pre
是一个ACF字段,包含如下格式的日期:
20180518
。然后,当我呼出
$date_l
,这是
$date_pre
的一个重新格式化的变体,它在工作日用瑞典语输入日数和月名(
lördag 18 maj
),它无法写出“åä”替换为问号符号。它在我的本地设置中起作用,但在我将主题上载到服务器时不起作用。

您的Web服务器是否将其输出为UTF-8?如何检查此项?检查并忽略其中的数据库部分。