PHP Classes

File: factorial.vxml.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Ben Yacoub Hatem  >  VXML  >  factorial.vxml.php  >  Download  
File: factorial.vxml.php
Role: Example script
Content type: text/plain
Description: factorial sample
Class: VXML
generate easily VXML document
Author: By
Last change: Added some change based on the version 1.0.1 of the class
Date: 12 years ago
Size: 1,260 bytes


Class file image Download

    /// Sample usage of vxml.class.php
    /// To calculate the factorial value of a number
include ("vxml.class.php");
$vxml_object=new voicexml;
$vxml_object->addscript( "
       function factorial(n)\n
       \treturn (n <= 1)? 1 : n * factorial(n-1);\n
$vxml_object->vxml_prompt("Tell me a number and I'll tell you its factorial.");
$vxml_object->addtext(" factorial is ");