php Library
XML_readFile
Keine Erläuterungen gefunden.
<?php function XML_readFile($fname){ $xml=""; if (file_exists($fname)) { $fid = fopen($fname, "r"); $line = fgets( $fid, 1024 ); while(!feof($fid)){ $xml.=$line; $line = fgets( $fid, 2048 ); } fclose($fid); }else{ printf("FILE ".$fname." DOES NOT EXIST!\n"); } /* neglect comments <!-- --> */ $continue=true; while ($continue){ $startComment=strpos($xml,"<!--"); $endComment=strpos($xml,"-->")+4; if (empty($startComment)){ $continue=false; }else{ $firstpart=substr($xml,0,$startComment); $lastpart=substr($xml,$endComment); $xml=$firstpart.$lastpart; } } return $xml; } ?>
Index of Library
Der gesamte Sourcecode darf gemäß GNU General Public License weiterverbreitet werden.