Read and echo specific source line from url.

Links for php scripts

Moderators: macek, egami, gesf

naustdal
New php-forum User
New php-forum User
Posts: 2
Joined: Tue May 07, 2013 12:24 am

Read and echo specific source line from url.

Postby naustdal » Thu May 23, 2013 1:09 pm

file_get_contents ('www.example.com’) have 300 lines of source. The line I need from a page is variable, it is changing the output every hour, but the line is always 58.

The line 58 have html that’s I need to copy and echo, as example “<td class=" plus temro">589</td>”
Next hour the line could look like this “<td class=" minus termo">-846</td>” and then “<td class=" plus termo">482</td>”


Need seriously help, have struggle long time with searching and testing a bunch of different code and ways, but no success :/
All i need is a simple code to find line, and echo "$result";

pbs
New php-forum User
New php-forum User
Posts: 39
Joined: Sat May 11, 2013 1:40 am
Location: Nashik, India
Contact:

Re: Read and echo specific source line from url.

Postby pbs » Sat May 25, 2013 3:37 am

Use file() function instead of file_get_contents(), it will return you content in array

Refer: http://php.net/manual/en/function.file.php


Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest

cron