init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
18
lib/sd/example/example_modify_contents.php
Normal file
18
lib/sd/example/example_modify_contents.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
// example of how to modify HTML contents
|
||||
include('../simple_html_dom.php');
|
||||
|
||||
// get DOM from URL or file
|
||||
$html = file_get_html('http://www.google.com/');
|
||||
|
||||
// remove all image
|
||||
foreach($html->find('img') as $e)
|
||||
$e->outertext = '';
|
||||
|
||||
// replace all input
|
||||
foreach($html->find('input') as $e)
|
||||
$e->outertext = '[INPUT]';
|
||||
|
||||
// dump contents
|
||||
echo $html;
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue