-
[PHP] Table Data
I need to make it so that my table located at www.footypro.com - First and Only stop for top quality Football! extracts the table information on the BBC's soccer league table, I also need it to format the data so that it fits in with my table. Any help will gladly be appreciated.
Webber.
-
Re: [PHP] Table Data
Please specify what help exacly you mean, do you mean to show you the way or point you the way how to do it or you need help with certain part of code.
-
Re: [PHP] Table Data
-
Re: [PHP] Table Data
K, then.
What you need to do is import the file, i don't know how the BBC page is built so i guess you would need to import whole file, by fopen i guess, going further then you need to read it using the fread function. Now as i said i have no idea how it's bulit, but i guess you will need to rip the table out of there byt chopping the text, if there is some kind of significant tag wich would describe the score table you will only need to explode the source by this tag ( ex. if it's only one table on page u can explode the table by "<table>" tag ). Next step is, using the preg_replace function, switching the table style attributes so it would look like the way you want it. I know it sounds complicated, but i have no better idea so far.
-
Re: [PHP] Table Data
Just grab the page from this site (curl, fopen, file_get_content... many ways), and use preg_match function
preg_match("|\<pre\>.*\</pre\>|s",$page,$matches);
If i didn't make error in reg exp, then in array matches you will have this table.