marklarah Posted March 11, 2009 Share Posted March 11, 2009 I know you can use fopen (I think my host may have disabled it,) but anyway, specifically, can you read the source code of it (as you would with view source) using php or even javascript of a remote page, and get specific bits parsing it with PHP? Link to comment https://forums.phpfreaks.com/topic/149016-is-there-a-way-to-read-data-off-a-remote-page/ Share on other sites More sharing options...
marklarah Posted March 11, 2009 Author Share Posted March 11, 2009 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? Link to comment https://forums.phpfreaks.com/topic/149016-is-there-a-way-to-read-data-off-a-remote-page/#findComment-782501 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.