Oracle Consulting Oracle Training Oracle Support Development
Home
Catalog
Oracle Books
SQL Server Books
IT Books
Job Interview Books
eBooks
Rampant Horse Books
911 Series
Pedagogue Books

Oracle Software
image
Write for Rampant
Publish with Rampant
Rampant News
Rampant Authors
Rampant Staff
 Phone
 800-766-1884
Oracle News
Oracle Forum
Oracle Tips
Articles by our Authors
Press Releases
SQL Server Books
image
image

Oracle 11g Books

Oracle tuning

Oracle training

Oracle support

Remote Oracle

STATSPACK Viewer

Privacy Policy

 

   
 

ss

Oracle Tips by Burleson 

array range ( number low, number high [, number step] )

This range() returns an array of elements from low to high, inclusive.  If low > high, the sequence is from high to low. The optional step parameter has been added in PHP 5.0.0.  If a step value is given, it is used as the increment between elements in the sequence. step should be given as a positive number. If not specified, step defaults to 1.  This function is extremely useful in looping through arrays with the foreach statement.

The following example shows how to do this:

Example 11:

#!/usr/local/bin/php
<?php
    $sum=0;
    $A=range(0,10);
    foreach(range(0,10) as $i) {
       $sum += $A[$i];
    }
    print("SUM=$sum\n");
?>

In this example the range function is used both to define the array $A and to loop through it to compute the sum. 

See code depot for complete scripts


The above book excerpt is from:

Easy Oracle PHP

Create Dynamic Web Pages with Oracle Data

ISBN 0-9761573-0-6   

Mladen Gogala

http://www.rampant-books.com/book_2005_2_php_oracle.htm

 

Download your Oracle scripts now:

www.oracle-script.com

The definitive Oracle Script collection for every Oracle professional DBA

Linux Oracle commands syntax poster

ION Oracle tuning software

Oracle data dictionary reference poster



Oracle Forum

BC Oracle consulting support training

BC remote Oracle DBA   

 

   

 Copyright © 1996 -2016 by Burleson. All rights reserved.


Oracle® is the registered trademark of Oracle Corporation. SQL Server® is the registered trademark of Microsoft Corporation. 
Many of the designations used by computer vendors to distinguish their products are claimed as Trademarks
 

Hit Counter