簡體   English   中英

如何在php中回顯xml?

[英]how to echo an xml in php?

我有此功能,我需要回顯XML,但它不起作用。 問題是什么?

static function login_xml($ERROR_ID,$SESSION_ID)
{
  echo "<BR>IN LOGINXML<BR>"; 


  echo '<xml version="1.0">'.
  '<response>log_in</response><parameters><error>'.$ERROR_ID.'</error><session>'
  .$SESSION_ID.'</session></parameters></xml>';
 }

我嘗試使用header('Content-type:text / xml'); 在回顯之前,這也不起作用。 我能做什么?

只需刪除線

echo "<BR>IN LOGINXML<BR>"; 

XML應該只有一個根元素,在您的情況下為<xml>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM