douluo3256
douluo3256
2016-01-21 13:28

XML中的打印值标记

已采纳

I sent request to web-sevice -

$result = $s->__call("SubmitXmlString",array($params));

$obj_pros = get_object_vars($result);
$xml =  $obj_pros['SubmitXmlStringResult']; 
$xml = simplexml_load_string($xml);
$array = $xml->int[0]->header;

var_dump ( $array);

this is the output:

object(SimpleXMLElement)[6]
  public 'ItinId' => string '39' (length=2)
  public 'Name' => string 'name of tour' (length=48)
  public 'Class' => string 'STD' (length=3)
  public 'Days' => string '10' (length=2)
  public 'Text' => 
    object(SimpleXMLElement)[8]
  public 'Include' => string 'text for include' (length=1296)
  public 'NotInclude' => string 'text for not include' (length=113)
  public 'Url' => string 'http://www.geotours.co.il' (length=82)
  public 'Status' => string 'OK' (length=2)

How do I print tag "name" value"?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • doufu3718 doufu3718 5年前

    try this code in your project

    $array->Name
    
    点赞 评论 复制链接分享

为你推荐