PHP输出的奇怪问题阿!求大神帮忙看看我看了一天没看懂哪里来的奇怪字符

WBOY
Release: 2016-06-23 13:46:52
Original
904 people have browsed it

首先我刚开始学php  写了个从数据库读完后 输出JSON的过程

看上去结果是对的阿~~~ 然后我去某效验网站   提示我  
于是我找了半天原因发现不知道哪里来的阿  在字符串前面有4个莫名其妙的东西。。。

请问这个是哪里来的阿 = = 我要怎么弄掉。。。
function index()
{
$cc=new DemoDao();
$resu=$cc->index();
$json=json_encode($resu);
$json=urldecode($json);
$total=24;
$json="{".'"total"'.":$total,".'"rows"'.":".$json."}";
echo $json;
}
最后输出Json的

急求大神 帮我看看~!!!!!!!!!!!!   编码都是utf-8


回复讨论(解决方案)

????{"total":24,"rows":[{"id":"1","name":"花","number":"5"},{"id":"3","name":"都","number":"0"},{"id":"4","name":"杂货店","number":"0"}]}



直接全选复制   就会把前面那4个东西复制进去

显然是bom头

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template