[ create a new paste ] login | about

Link: http://codepad.org/uOqeBNz9    [ raw code | output | fork | 1 comment ]

PHP, pasted on Jan 16:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

$xml = '<xml>
<status>0</status>
<error code="111">Error message text goes here.</error>
</xml>';


    $xml = simplexml_load_string($xml );

    echo '<pre>'; print_r($xml); echo '</pre>';

echo "error code" . $xml->error['code'];


?>


Output:
1
2
3
4
5
6
<pre>SimpleXMLElement Object
(
    [status] => 0
    [error] => Error message text goes here.
)
</pre>error code111


Create a new paste based on this one


Comments:
posted by admin on May 2

reply