PHP script has extra 0 at the end of the output on a cellular connection

烂漫一生 提交于 2019-12-24 02:24:03

问题


I have a very simple PHP script as follows:

<?php

    echo "$$";

?>

On wifi or wired connections, the output is normal, as follows:

$$

But on my cellular connection (which is LTE on AT&T), the output is:

$$0

What's up with the zero in the output?

The issue only seems to happen on AT&T network, I tried on Verizon network and it was working.


回答1:


Adding this line of code solved the problem:

header('Content-Type: text/plain; charset=utf-8');


来源:https://stackoverflow.com/questions/25467118/php-script-has-extra-0-at-the-end-of-the-output-on-a-cellular-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!