我有:
function fetchlinks(){
## include the simpledom helper #########################################################
$this->load->helper('simpledom');
$this->simpledom->file_get_html("http://www.thesite.net/thesitepath");
############################################################################################
$htmlToSearch = file_get_html("http://www.thesite.net/thesitepath");
foreach($htmlToSearch->find('a') as $element){
echo "<h1 style='color:red; '>".$element->href."</h1> <br />";
}
}我在这里调用并使用该函数:
$this->load->helper('simpledom');
$this->simpledom->file_get_html("http://www.thesite.net/thesitepath");然后如何在我的foreach{}中使用^^行的内容
发布于 2013-01-23 01:07:17
助手函数只是声明的函数,如果需要的话会加载它们。它们不是CI实例的属性。
请参阅这里的文件。
https://stackoverflow.com/questions/14470803
复制相似问题