When i comment away them all and put print_r($f); i can see the page i want to see.
(If you haven't notice it, the whole thing is about to search thru the site and find a speciell picture and show only the picture.)
With or withou the other code comment i get the page I want to search thru to just find the picture.
EDIT:
no help if the code is in body or not.. :/
<?php
function get_contents($url){
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$contents = curl_exec($ch);
if (curl_errno($ch)) {
$contents = '';
} else {
curl_close($ch);
}
if (!is_string($contents) || !strlen($contents)) {
$contents = '';
}
return $contents;
}
$f = get_contents("http://xxx.xxx");
$f = str_replace("\n", "", $f);
$f = str_replace(" ", "", $f);
preg_match_all('|<tr valign="middle"><td align="center" style="width: 557px;"><img src="(.*)" id="picture" /></td></tr>|i', $f, $out);
echo $out[1][0];
?>
I also got this code for the same thing.
The other code (this one) gives me an error:
Fatal error: Call to undefined function curl_init() in C:\wamp\www\3.php on line 3
and line 3 is like
$ch = curl_init();