Metacontenttexthtml; charsetutf-8http-equivContent-Type? PhpThefiletest. xmlcontainsanXMLdocumentwitharootelementandatleastanelement [root] title. $ xmlfiledate (YmdH).. xml; $ sourcexmlmedcl. n
Meta content = "text/html; charset = UTF-8" http-equiv = "Content-Type "? Php // The file test. xml contains an XML document with a root element // and at least an element/[root]/title. $ xmlfile = date ('ymmdh '). '. xml'; $ sourcexml = 'HTTP: // medcl. n
// The file test. xml contains an XML document with a root element
// And at least an element/[root]/title.
$ Xmlfile = date ('ymmdh'). '. xml ';
$ Sourcexml = 'HTTP: // medcl.net/SinaRss.aspx? Uid = 1562882353 ';
// Die ($ xmlfile );
If (! File_exists ($ xmlfile )){
Echo 'the first time you visited the system. Initializing ...';
$ Str = @ file ($ sourcexml) or die ('An error occurred while loading the file. ');
$ Str = join ('', $ str );
$ Fp = fopen ($ xmlfile, 'w') or die ('write cache failed! ');
Fputs ($ fp, $ str );
Fclose ($ fp );
Echo "Initialization is complete. ";
}
If (file_exists ($ xmlfile )){
$ Xml = simplexml_load_file ($ xmlfile );
// Print_r ($ xml );
$ C = & $ xml-> channel;
Echo'
Link. '">'. $ c-> title .'
';
Echo'
'. $ C-> lastBuildDate .'
';
$ Listhead ='
';
Echo $ listhead;
$ K = 0;
Foreach ($ c-> item as $ v ){
$ K ++;
Echo"
";
}
Echo'
| Serial number |
Title |
Author |
Category |
Comment |
Time |
| $ K |
Title. "href =". $ v-> link. "> $ v-> title |
$ V-> author |
$ V-> category |
Comments. "> comment |
$ V-> pubDate |
';
} Else {
Exit ('failed to open xml file .');
}
?>