如何使用Simple HTML DOM Parser找到内容"Please enter a valid key again"?
示例:
<script language="javascript">
function Enable() {
alert('Please enter a valid key again');
}
</script>
这似乎不起作用:
<?php
include_once("simple_html_dom.php");
$html = file_get_html("incorrect.html");
$ret = $html->find("Please enter a valid key again", 0);
if ($ret) {
echo "found";
} else {
echo "not found";
}
?>
您可以用一种更简单的方法来实现这一点:
<?php
include_once("simple_html_dom.php");
$html = file_get_html('incorrect.html');
(strstr($html,'Please enter a valid key again')) ? print("found") : print("not found");
?>