Login   Register  
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 R.B. Klaassen  >  Number Sequence  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: Number Sequence
Format an array of numbers as a sequence or ranges
Author: By
Last change: Changed the example array
Date: 6 years ago
Size: 494 bytes
 

Contents

Class file image Download
<?php
/**
 * Example of numberSequence class
 */

require_once('numberSequence.class.php');

$my_array = array(1,3,4,5,8,10,12,13,14,500,501,498,499,12,12,12,0,2);

// you can either do this
echo '<p>array('.implode(',',$my_array).') gives: '.numberSequence::format($my_array).'</p>';

// or instantiate the class if you intent to use it more often in your page
$obj = new numberSequence();
echo 
'<p>array('.implode(',',$my_array).') gives: '.$obj->format($my_array).'</p>';

?>