<?php// 新建一个Dom实例$html->load_file('http://www.cnphp.info/php-simple-html-dom-parser-intro.html'); // 从字符串中加载 $html->load('从字符串中加载html文档演示'); //从文件中加载 $html->load_file('path/file/test.html');?>说是三种加载方式 但是load_file这是什么函数 手册里面也查不到
解决方案 »
- PHP传值问题,求高手解救!!
- 老问题刚解决,新问题来了,来看看我的Php用的哪个数据库?
- 求助 写一个PHP函数,它查找并且返回某个数组的最大值。并附上测试结果
- 主机不能访问虚拟机
- 大家都来说说用什么工具开发php?
- 为什么我的kindeditor工具栏没有出现
- 如何在我的网页实时显示一批网页的alexa排名?
- 在提交表单时打开一个没有工具拦,和地址栏的新窗口
- 请问这样的系统应该选择哪种语言呢?谢谢~
- 如何在Linux下解析带附件的邮件
- 在网页提交按钮下创建一个响应函数,创建一个socket,每次发送数据都使用该socket?
- 目前有个需求,用户需要连续6个月,每月订单数量大于或等同于60单以上,用户的身份会升级,php mysql 应该怎样实现啊?
function load_file() {
$args = func_get_args();
$this->load(call_user_func_array('file_get_contents', $args), true);
// Per the simple_html_dom repositiry this is a planned upgrade to the codebase.
// Throw an error if we can't properly load the dom.
if (($error=error_get_last())!==null) {
$this->clear();
return false;
}
}使用 simple_html_dom 的方法有
$sh = file_get_html('文件名或url');
$sh = str_get_html('字符串');
$sh = new simple_html_dom('文件名或url或字符串');当然你说的也是,不过显得累赘些