PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Eugene Panin   Parser   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Usage example
Class: Parser
Author: By
Last change:
Date: 24 years ago
Size: 576 bytes
 

Contents

Class file image Download
<html>
<body bgcolor=white>
<?
require('Parser.php');

$parser = new Parser('sample.cfg');
if (
$parser->error()) {
        echo
"Error: ".$parser->error()."<p>";
}

$s_list = $parser->sections();
while (list(
$key,$sec_name)=each($s_list)) {
       
$p_list = $parser->parameters($sec_name);
        echo
"$sec_name";
        echo
"<ul>";
        while (list(
$key,$par_name)=each($p_list)) {
               
$val = $parser->param($sec_name,$par_name);
                echo
"$par_name => $val<br>";
        }
        echo
"</ul>";
}


?>
</body>
</html>