Hi all,
I am trying to reformat the weather information from this site: http://cdec.water.ca.gov/cgi-progs/queryF?s=OSO. I was able to retrieve the entire HTML page using:
<?
$theURL = "http://cdec.water.ca.gov/cgi-progs/queryF?s=OSO";
$file = fopen("$theURL", "r");
$rf = fread($file, 20000);
fclose($file);
echo $rf;
?>
However, I encounter two problems.
All the links now are appended after my home directory, so I could not go to the correct page.
I want to do some formatting with the data on this page. For example, I want to change the font and size of the text, replace the table headings with some other text, and add other contents.
Most importantly, I want to remove the images of the original page. For this, I tried
$printing[1] = str_replace("<img src=...>", "", $rf);
But it won't work. I am a beginner with PHP, and would appreciate any help or suggestion on this subject.
Thank you very much!
Cat