PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Jonas Raoni Soares Silva   Advanced Randomizer   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Simple to understand and small
Class: Advanced Randomizer
Retrieve random items based on given probability
Author: By
Last change:
Date: 20 years ago
Size: 316 bytes
 

Contents

Class file image Download
<?php
include( 'lib.probabilityRandom.php' );

$prExample = new probabilityRandom;

$prExample->add( 'I have more chances than everybody :]', 30 );
$prExample->add( 'I have good chances', 10 );
$prExample->add( 'I\'m difficult to appear...', 1 );

for(
$x=10; $x--; print $prExample->get() . '<br />' );
?>