douhua1890 2014-10-27 01:44
浏览 50

PHP声明编码会产生致命错误?

Example #3 of Php manual's declare(encoding) (source) has this snippet of code:

<?php
declare(encoding='ISO-8859-1');
// code here
?>

However, when I tried to run the exact code above, it doesn't work:

Fatal error: Encoding declaration pragma must be the very first statement in the script in C:\xampp\htdocs\test\index.php on line 2

The error message asserts that declare is not the first statement, but the code shows that there's nothing before it.

What may be causing the error?

How do we fix it?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 双层网络上信息-疾病传播
    • ¥50 paddlepaddle pinn
    • ¥20 idea运行测试代码报错问题
    • ¥15 网络监控:网络故障告警通知
    • ¥15 django项目运行报编码错误
    • ¥15 请问这个是什么意思?
    • ¥15 STM32驱动继电器
    • ¥15 Windows server update services
    • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
    • ¥15 模糊pid与pid仿真结果几乎一样