Hello.
I am interested in making a script that scans a certain html page for a certain line and outputting that line in my own script (I want to create a dynamic image). I am familiar with readfile(), but that doesn't do the job very well as it just copies and pastes the whole code in the output buffer. I need a different solution. Can anyone point me in the right direction?
Thanks.
[SOLVED] Reading data from a page on the internet
Moderator: General Moderators
- evilmonkey
- Forum Regular
- Posts: 823
- Joined: Sun Oct 06, 2002 1:24 pm
- Location: Toronto, Canada
[SOLVED] Reading data from a page on the internet
Last edited by evilmonkey on Tue Jun 29, 2004 6:18 pm, edited 1 time in total.
- evilmonkey
- Forum Regular
- Posts: 823
- Joined: Sun Oct 06, 2002 1:24 pm
- Location: Toronto, Canada
file_get_conternts works for me. Also, how can I limit the reading of the string...for example, I use strstr($haystack, $needle), but that gives me everything after $needle. I would like to display 3 characters AFTER $needle (not including $needle iteself). Those 3 characters will always change, but $needle will not. Help please.
Thanks.
Thanks.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
substr($contents,strpos($contents, $needle) + strlen($needle),3);there's of course the regex ways too..
- evilmonkey
- Forum Regular
- Posts: 823
- Joined: Sun Oct 06, 2002 1:24 pm
- Location: Toronto, Canada