string - Getting elements of a div from another page (PHP) -
so have page one:
<div id="div1">this text one</div> <div id="div2">this text two</div> <div id="div3">this text three</div> now want elements of div one, return this text one, how can that?
you can use domdocument in php:
<?php $doc = new domdocument; // need validate our document before refering id $doc->validateonparse = true; $doc->loadhtml(file_get_contents('http://google.com/bla.php')); var_dump($doc->getelementbyid('div1')); ?>
Comments
Post a Comment