Getting an external piece of file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
evank3
Forum Newbie
Posts: 1
Joined: Wed Feb 21, 2007 3:57 am

Getting an external piece of file

Post by evank3 »

Ok, so I want to get a piece of an external file to be able to show up in my page without any other part of the file attached.

The file has a lot of coding, so I thought I'd just give you a small piece of it. The file has numbers that frequently update so thats why I can't just copy them into my page.

Here is an example of part of the file:

Code: Select all

<td align="right">236,703</td>
<td align="right">73</td>
<td align="right">1,093,574</td>
In the code above I would just want the number: 1,093,574.

Is it possible for me to use fgetss() to get just that line without the html? or is that not what fgetss() does. The easiest way to do this would be just to use a code to get a line from the external page without html tags on it. Is that possible? Anyways please help me get this working. Also the number 1,093,574 is on line 196 if that makes any difference.

Thanks a lot!
evank3
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

file_get_contents() and preg_match() may be of interest.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: Getting an external piece of file

Post by volka »

evank3 wrote:Ok, so I want to get a piece of an external file to be able to show up in my page without any other part of the file attached.
Please make sure the "original provider" doesn't mind.
Post Reply