PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 10 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 />' );
?>