Get html block by PHP -
we have html page, has many code inside.
sometimes has block #container
, not.
all code of page inside $page
variable.
how i:
- check, there block
id="container"
? - if html page has
#container
inside, contents of block , write variable$container
.
task should done php.
one of possible ways solve problem use third party library. let's http://simplehtmldom.sourceforge.net/:
$html->load($page); if ($html->find('#container')) $container = $html->find('#container');
Comments
Post a Comment