<?php $doc = new DOMDocument; $doc->loadHTML('<html><body id="x"></body></html>'); $body = $doc->getElementById('x'); $div = $doc->createElement('div'); $div->setAttribute('id', 'y'); echo '0: ' . ( $doc->getElementById('y') ? $doc->getElementById('y')->tagName : 'null' ) . PHP_EOL; // div $body->appendChild($div); echo '1: ' . ( $doc->getElementById('y') ? $doc->getElementById('y')->tagName : 'null' ) . PHP_EOL; // div $div->setIdAttribute( 'id', true ); echo '2: ' . ( $doc->getElementById('y') ? $doc->getElementById('y')->tagName : 'null' ) . PHP_EOL; // null
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`