Jump to content

Is there a way to read data off a remote page?


marklarah

Recommended Posts

Okay wait, I have this

<?php
$url = "http://www.google.com";
       $ch = curl_init();
       $timeout = 5; // set to zero for no timeout
       curl_setopt ($ch, CURLOPT_URL, $url);
       curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
       curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
       $file_contents = curl_exec($ch);
       curl_close($ch);
?>

 

This uses cURL and is good, works fine. But lets say for example, there was a value in the source generated by the server, but always came before a set constant. If I wanted to just get the URL for the google logo for example, how would I do that using the PHP string functions?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.