PHP Classes

File: example.php

Recommend this page to a friend!
  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: 14 years ago
Size: 494 bytes


Class file image Download
 * Example of numberSequence class


$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();
'<p>array('.implode(',',$my_array).') gives: '.$obj->format($my_array).'</p>';