Hey everyone, I'm new here at Phpbuilder! Hopefully I'll be a regular here. Anyways, I have a question. I'm trying to make a script to read a website's html source code then find a line like "<td class="alt8 txtD">12,997<sup>th</sup></td>" I want to find the green highlighted text then be able to print it on my website. I'm wanting to do this because I don't want to manually update my webpage with that number when it changes. Is this possible to do? I hope you guys understand what I'm trying to do. I've searched around the forum and found this code:
<?php
// Get a file into an array. In this example we'll go through HTTP to get
// the HTML source of a URL.
$lines = file('http://www.example.com/');
// Loop through our array, show HTML source as HTML source; and line numbers too.
foreach ($lines as $line_num => $line) {
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
}
// Another example, let's get a web page into a string. See also file_get_contents().
$html = implode('', file('http://www.example.com/'));
I think this is a good start but I don't know exactly what to do to print the text on my webpage and etc.