Welcome Guest, Not a member yet? Register   Sign In
How to use Php DOMDocument object in ci4
#1

$result is post parameter .I want to try but not working.

error: Class 'App\Controllers\DOMDocument' not found

$resultDocument = new DOMDocument();

$resultDocument->loadXML($result);


$stateNode = $resultDocument->getElementsByTagName("state")->item(2);


$status = "";

if( $statusNode != null )

  $status = $stateNode->nodeVal;

Thank you for helps.
Sercan YANBULOGLU
SEO links REDACTED, per forum policy
Reply
#2

Put a \ before to use native classes in PHP. new \DOMDocument();
Reply




Theme © iAndrew 2016 - Forum software by © MyBB