亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

這是什么問題?

This page contains the following errors:

error on line 2 at column 1: Extra content at the end of the document

Below is a rendering of the page up to the first error.

正在回答

4 回答

本頁包含以下錯誤:

在1列2行錯誤:在文檔末尾的額外內容

下面是一個渲染的頁面上的第一個錯誤。


0 回復 有任何疑惑可以回復我~
#1

打死不信邪 提問者

非常感謝!
2015-06-17 回復 有任何疑惑可以回復我~

把你 的PHP代碼發過來看看

0 回復 有任何疑惑可以回復我~

我也遇到了類似的問題

0 回復 有任何疑惑可以回復我~

public static function xmlEncode($code,$message = '',$data = array()){

if (!is_numeric($code)) {

return '';

}

$result = array(

'code' => $code,

'message' => $message,

'data' => $data,

);

header("Content-Type:text/xml");

$xml = "<?xml version='1.0' encoding='UTF-8'?>\n";

$xml .="<root>\n";

$xml .=self::xmlToEncode($result);

$xml .="</root>";

echo $xml;

}


public static function xmlToEncode($data){

$xml ="";

foreach ($data as $key => $value) {

if (is_numeric($key)) {

$attr = "id='{$key}'";

$key = "item";

}

$xml .="<{$key}{$attr}>";

$xml .=is_array($value) ? self::xmlToEncode($value) : $value;

$xml .="</{$key}>\n";

}

return $xml;

}


}

$data = array(

'id' => '1',

'name' => 'wufei',

'type' => array(4,5,6),

'test' =>array(1,45,12=>array(155,'ttt')),

);

Response::xmlEncode(200,'數據傳輸成功',$data);


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
PHP開發APP接口
  • 參與學習       79159    人
  • 解答問題       608    個

APP通信接口技術,不得不掌握的法寶,學完之后你會受益良多

進入課程

這是什么問題?

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號