PHP Classes

File: examples/ToRanges.php

Recommend this page to a friend!
  Classes of Christian Vigh   PHP Array Helpers   examples/ToRanges.php   Download  
File: examples/ToRanges.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Array Helpers
Perform several array manipulation operations
Author: By
Last change: Update of examples/ToRanges.php
Date: 1 year ago
Size: 530 bytes
 

Contents

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

        The following example demonstrates the use of the ArrayHelpers::ToRanges function.

     ***********************************************************************************************************/
   
require ( '../ArrayHelpers.phpclass' ) ;

    if (
php_sapi_name ( ) != 'cli' )
        echo (
"<pre>" ) ;

   
$array = [ 1, 10, 4, 11, 3, 12, 20, 2, 21, 5 ] ;
   
print_r ( ArrayHelpers::ToRanges ( $array ) ) ;