PHP Classes

File: grammar_test1_php

Recommend this page to a friend!
  Classes of Mark Headd  >  PHP Grammar  >  grammar_test1_php  >  Download  
File: grammar_test1_php
Role: Example script
Content type: text/plain
Description: Simple grammar example
Class: PHP Grammar
Create speech recognition grammar W3C XML files
Author: By
Last change:
Date: 17 years ago
Size: 647 bytes
 

Contents

Class file image Download
<?php

// Set MIME type for XML grammar fomat
header('Content-type: application/grammar+xml');

//Include base class
require ('grammar.php');

/*
This example makes calls to methods in the base grammar class to create a simple XML grammar file
*/

// Create new grammar object and call appropriate methods from base class
$page = new grammar;
$page->gramStart();
$page->ruleStart();
$page->oneOfstart();
$page->itemStart();
echo
"one";
$page->itemEnd();
$page->itemStart();
echo
"two";
$page->itemEnd();
$page->itemStart();
echo
"three";
$page->itemEnd();
$page->oneOfend();
$page->ruleEnd();
$page->gramEnd();

?>

For more information send a message to info at phpclasses dot org.