这是什么问题?

来源:2-4 综合方式封装通信数据方法

打死不信邪

2015-04-20 17:36

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.

写回答 关注

5回答

  • zejiaaaa
    2015-06-07 21:13:26
    已采纳

    本页包含以下错误:

    在1列2行错误:在文档末尾的额外内容

    下面是一个渲染的页面上的第一个错误。


    打死不信邪

    非常感谢!

    2015-06-17 11:38:53

    共 1 条回复 >

  • singwa
    2015-04-20 22:34:46

    把你 的PHP代码发过来看看

  • qq_慕神1420022
    2022-04-01 20:44:26

    父类Car的speedUp()方法输出结果是10,加上子类speedUp方法中的50,得出的结果就是60

    spd10000duivlemrmlvmjpkqpoefkubixrlypvvrjxelputrjpaeex

  • 小灰灰heart
    2015-08-07 10:11:58

    我也遇到了类似的问题

  • 打死不信邪
    2015-04-21 09:09:38

    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);


PHP开发APP接口

APP通信接口技术,不得不掌握的法宝,学完之后你会受益良多

79207 学习 · 599 问题

查看课程