PHP Classes

File: example/example_remove_content.php

Recommend this page to a friend!
  Classes of Lars Moelleken  >  Simple HTML DOM  >  example/example_remove_content.php  >  Download  
File: example/example_remove_content.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Simple HTML DOM
Manipulate HTML elements using DOMDocument
Author: By
Last change: Update of example/example_remove_content.php
Date: 10 months ago
Size: 382 bytes


Class file image Download

use voku\helper\HtmlDomParser;


$templateHtml = '

// remove: "<br>" from "<ul>"
$htmlTmp = HtmlDomParser::str_get_html($templateHtml);
foreach (
$htmlTmp->find('ul br') as $br) {
$br->outertext = '';

$templateHtml = $htmlTmp->save();

// dump contents
echo $templateHtml;

For more information send a message to info at phpclasses dot org.