Filter XML by elements [duplicate]
问题 This question already has answers here : Split foreach to pages (2 answers) Closed 6 years ago . <?php $files = glob( 'docs/*.xml' ); if ( isset( $_GET['doctype'] ) == "all" ) { foreach ( $files as $file ) { $xml = new SimpleXMLElement( $file, 0, true ); echo' <tr> <td id="'. $xml->doctype .'" name="'. $xml->doctype .'" class="mainTable">' . $xml->doctype . '</td> <td><a href="viewdoc.php?docname=' . basename( $file, '.xml' ) . '&username='. $xml->startedby .'&myname='. $_SESSION['username']