display parts of content from remote webpage
Posted: Wed Oct 06, 2004 8:57 am
feyd | Please use
This reads 8192 bytes. How do I know the amount I need to read? I really don't want to read the whole page. Is it at all possible to retrieve just parts of another webside, such as weatherinfo? Or do I have to get access to an xml file containing the info I want?
Any suggestions on this would help a lot.
Thanks
feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
I'm trying to add some content from a remote webpage to my site. I've tried to search for something like this on the forums, but can't really find anything.
Using PHP, how can I simply read some content, for eks. weather info from a remote site (not web service). I have tried out this:Code: Select all
$fp = fopen("http://somesite.com", "r");
$contents = '';
$contents .= fread($fp, 8192);
echo $contents;
fclose($fp);Any suggestions on this would help a lot.
Thanks
feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]