PHP CURL SAME HTML ELEMENT
i want to output the third element from the same html element , i know how
to output a div/span with a id or a class but i have no idea how to output
a same html element, i tought it was something with p[1] but it doesnt
work , i know there is a lot of answered questions about it but it never
explained how to output the same html element without a class/id
website : http://localhost/
<p>example</p>
<p>example1</p> <!-- i want to take this one -->
<p>example2</p>
-------------------
php script :
<?php $curl = curl_init('http://localhost/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$code3 = curl_exec($curl);
curl_close($curl);
$code = '/<h1>(.*?)<\/h1>/s';
$code6= preg_match($code, $code3, $code4);
echo $code4[1]
?>
/* doesnt work ..
also php.net doesnt give a good example about it so i hope someone can
help me here.
thanks advanced !
*/
No comments:
Post a Comment