| 1 |
<?php |
| 2 |
// example of how to modify HTML contents |
| 3 |
include('../simple_html_dom.php'); |
| 4 |
|
| 5 |
// get DOM from URL or file |
| 6 |
$html = file_get_html('http://www.google.com/'); |
| 7 |
|
| 8 |
// remove all image |
| 9 |
foreach($html->find('img') as $e) |
| 10 |
$e->outertext = ''; |
| 11 |
|
| 12 |
// replace all input |
| 13 |
foreach($html->find('input') as $e) |
| 14 |
$e->outertext = '[INPUT]'; |
| 15 |
|
| 16 |
// dump contents |
| 17 |
echo $html; |
| 18 |
?> |