PHP Classes

File: examples/getintegers.php

Recommend this page to a friend!
  Classes of Christian Vigh   PHP Random.Org API   examples/getintegers.php   Download  
File: examples/getintegers.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Random.Org API
Generate random values using random.org
Author: By
Last change: Update of examples/getintegers.php
Date: 1 year ago
Size: 1,046 bytes
 

Contents

Class file image Download
<?php
   
/**************************************************************************************************************

        getintegers.php -
        Echoes the number of integer values specified by the $count variable.
        The returned value will be between $min and $max for the first run, and will not use any range limit
        for the second one.
   
     **************************************************************************************************************/
   
require ( 'examples.inc.php' ) ;

   
$random = new RandomOrg ( $agent_string ) ;
   
$count = 10 ;
   
$min = 1 ;
   
$max = 100 ;
   
   
$values = $random -> GetIntegers ( $count, $min, $max ) ;

    echo (
"Getting $count random integer values between $min and $max :\n" ) ;
    echo (
"\t" . implode ( ', ', $values ) . "\n" ) ;

   
display_statistics ( $random ) ;

    echo (
"\n" ) ;

   
$values = $random -> GetIntegers ( $count ) ;

    echo (
"Getting $count random integer values without range limits :\n" ) ;
    echo (
"\t" . implode ( ', ', $values ) . "\n" ) ;

   
display_statistics ( $random ) ;