Search Webmaster Help and Solution

php and xml coding help

How can I get it so the following work:

echo utf8_decode($xml->healings[0]->$xmla[0]->descrip[0]); // NOT work
echo utf8_decode($xmlb); // NOT work

PHP Code: <?php
  $xml    = simplexml_load_file(extra.xml);
  $xmla   = test;
  $xmlb  = $xml->healings[0]->.$xmla.[0]->descrip[0];

  echo utf8_decode($xml->healings[0]->test[0]->descrip[0]);        // works

  echo utf8_decode($xml->healings[0]->$xmla[0]->descrip[0]);     // NOT work

  echo utf8_decode($xmlb);     // NOT work

?> How can I get it so the following work:

echo utf8_decode($xml->healings[0]->$xmla[0]->descrip[0]); // NOT work
echo utf8_decode($xmlb); // NOT work

PHP Code: <?php
  $xml    = simplexml_load_file(extra.xml);
  $xmla   = test;
  $xmlb  = $xml->healings[0]->.$xmla.[0]->descrip[0];

  echo utf8_decode($xml->healings[0]->test[0]->descrip[0]);        // works

  echo utf8_decode($xml->healings[0]->$xmla[0]->descrip[0]);     // NOT work

  echo utf8_decode($xmlb);     // NOT work

?>

View Complete Thread with Replies

Related Items

Query failed: connection to localhost:3354 failed (errno=111, msg=Connection refused).