Heim  >  Artikel  >  Backend-Entwicklung  >  服务器返回出现:error on line 19 at column 1: Extra content at the end of the document

服务器返回出现:error on line 19 at column 1: Extra content at the end of the document

WBOY
WBOYOriginal
2016-08-08 09:25:023241Durchsuche

  PHP APP接口开发中与服务器交互,返回数据时如出现以下错误

   JSON方式返回数据,火狐浏览器如果显示如图:

    XML方式显示返回数据,火狐浏览器显示如图:

   

    JSON与XML方式返回数据,猎豹浏览器显示如图:

   

 原因有可能包括以下几点:

(1)这种情况是服务器处理返回了,但是返回的格式有问题。

          查看返回数据的格式是否为需要的格式,比如JSON格式, header("Content-Type:text/json");

(2)正常返回的过程中,有输出,返回的结果不对。

         

(3)需要注意的是XML文档声明只允许出现在文档的开始位置

           

以上就介绍了服务器返回出现:error on line 19 at column 1: Extra content at the end of the document,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:php 建造者模式Nächster Artikel:Smarty-1 (18)