PHP code example of dlindberg / dom-document-factory
1. Go to this page and download the library: Download dlindberg/dom-document-factory library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
php
$html = '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>'; // Etc. Etc.
$docFactory = new dlindberg\DOMDocumentFactory();
$DOMNode = $docfactory($html);
/* Do something with your DOMNodes */
echo $docFactory->stringify($DOMNode->firstChild);
html
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>In vel nibh eget turpis sagittis posuere ut vitae purus.<p>
<p>Donec in libero mauris. Aenean eu consectetur tortor.</p>
<p>Sed dolor neque, maximus et est eu, ultricies interdum libero.</p>
<p>Cras sed feugiat ante. Suspendisse ultrices eros at arcu feugiat dictum.</p>
html
<body>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>In vel nibh eget turpis sagittis posuere ut vitae purus.<p>
<p>Donec in libero mauris. Aenean eu consectetur tortor.</p>
<p>Sed dolor neque, maximus et est eu, ultricies interdum libero.</p>
<p>Cras sed feugiat ante. Suspendisse ultrices eros at arcu feugiat dictum.</p>
</body>
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.