Playing Simple PHP Dom Parser In Advance
I want to do something advanced with PHP Simple HTML DOM Parser but can't understand how to do so..
What I want to do: Suppose we are getting some url from here
foreach($result->find('a') as $element)
$element->href
and now i want to get its content as plain text but note that I am going to fetch full content from that pages.
Suppose this script has a variable called $sn = 'linkin park song';
- is there any way to fetch lines from those pages which have the keywords from $sn
If you don't understand what I want to do then here is a example.
Suppose $sn = 'Google 2012 Earning Report';
so PHP SIMPLE DOM PARSER will get some url from $element->href
, such as:
http://www.dailytech.com/Google+Q2+2012+Earnings+Rise+11+Percent+Deals+with+Falling+Ad+PricesMotorola+Issues/article25221.htm
It will fetch plain text from this url, which match $sn
:
Google's Q2 2012 earning are looking good despite certain issues ...
Google's latest Earning Report is result of its ability to better target...
链接地址: http://www.djcxy.com/p/29854.html
下一篇: 提前玩简单的PHP Dom解析器