I am trying to find an element in html document using php.
include_once('simple_html_dom.php');
$handle = fopen("exercise/Exercise.php", "r");
$file = fread($handle ,8192);
$handle = file_get_html('exercise/Exercise.php');
if (!empty($handle)) {
$ret = $handle->find('div[id=abc]');
}
but I have no idea What to do with $ret
now? or even check has it found <div id="abc">
or not?is this even the right way I don't know because I am not very good at php?
Edit that question is way to vast for me understand.
它应该是
$handle->find('div[id=abc]', 0);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.