怎么在php中使用simple_html_dom解析HTML-创新互联

今天就跟大家聊聊有关怎么在php中使用simple_html_dom解析HTML,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

成都创新互联公司-专业网站定制、快速模板网站建设、高性价比砚山网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式砚山网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖砚山地区。费用合理售后完善,十载实体公司更值得信赖。

用法示例:


find('a') as $e) 
  echo $e->href . '
'; // find all image foreach($html->find('img') as $e)   echo $e->src . '
'; // find all image with full tag foreach($html->find('img') as $e)   echo $e->outertext . '
'; // find all div tags with id=gbar foreach($html->find('div#gbar') as $e)   echo $e->innertext . '
'; // find all span tags with class=gb1 foreach($html->find('span.gb1') as $e)   echo $e->outertext . '
'; // find all td tags with attribite align=center foreach($html->find('td[align=center]') as $e)   echo $e->innertext . '
'; // extract text from table echo $html->find('td[align="center"]', 1)->plaintext.'

'; // extract text from HTML echo $html->plaintext; ?>

看完上述内容,你们对怎么在php中使用simple_html_dom解析HTML有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注创新互联行业资讯频道,感谢大家的支持。


网站栏目:怎么在php中使用simple_html_dom解析HTML-创新互联
文章起源:http://myzitong.com/article/cocjhc.html