roi
roi

Reputation: 23

print value tag from 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"?

Upvotes: 0

Views: 40

Answers (1)

paranoid
paranoid

Reputation: 7105

try this code in your project

$array->Name

Upvotes: 1

Related Questions