[ create a new paste ] login | about

Link: http://codepad.org/Bss1rndd    [ raw code | output | fork ]

PHP, pasted on Sep 14:
1
2
3
4
5
6
7
<?php
$xmlstring = "<parent><child> hello world </child></parent>";
$xml = simplexml_load_string($xmlstring);
$foo = array( (string) $xml->child );
var_dump($xml).PHP_EOL;
var_dump($foo);
?>


Output:
1
2
3
4
5
6
7
8
object(SimpleXMLElement)#1 (1) {
  ["child"]=>
  string(13) " hello world "
}
array(1) {
  [0]=>
  string(13) " hello world "
}


Create a new paste based on this one


Comments: