bcarl314

03-08-2004, 06:07 PM

I'm trying to incorporate some data into an intranet web page. The data I need is on this (http://www.tsp.gov/rates/monthly-current.html) web page. It's a really simple design, but the html is pretty bad.

I was thinking of using a regular expression to grab all the cell data, and put it into an 2 dimensional array. Something where $array[0] would be the first row and $array[1] would be the second row and so on.

so

$array[0][0];

would be the first cell in the first row.

I can't seem to get the regex to work any ideas?

Here's what I'm using:

$data[] = preg_replace("=\<td.*\>(.*?)\</td\>=is", '<strong>$1</strong>', $page);

Where $page is the html of the page I'm using.

I was thinking of using a regular expression to grab all the cell data, and put it into an 2 dimensional array. Something where $array[0] would be the first row and $array[1] would be the second row and so on.

so

$array[0][0];

would be the first cell in the first row.

I can't seem to get the regex to work any ideas?

Here's what I'm using:

$data[] = preg_replace("=\<td.*\>(.*?)\</td\>=is", '<strong>$1</strong>', $page);

Where $page is the html of the page I'm using.