A webiste www.example.com have many lists in it. That is,
<ol>
<li>This is a list saying about asp</li>
<li>This is a list saying about javascript</li>
<li>This is a list saying about php</li>
<li>This is a list saying about .net</li>
</ol>
I need to Get the list with a word "php" using php.
That is the output should be "This is a list saying about php"
How can i do this with preg_match???
I used CURL class to fetch the HTML contents. here is the code i used
$site = $curl->get("http://www.example.com/outputs.html");
$pattern = 'I NEED TO GET THIS PATTERN';
preg_match($pattern, $site, $matches);
$php_out = $matches[1];
echo $php_out;
when i use,
$pattern = '/<li>(.*?)<\/li>/s';
It returns the first result
That is "This is a list saying about asp"