Your technology certification is waiting. Enroll in Cloud Class ®
<?php // RAY_temp_alexponnath.php
// SEE http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28297482.html
* Specify a max nbr to loop thru like 1 thru 1000
* Specify a start value for index any numeric value
* Each time index should increase by 1
* 2nd value should be a random 10 digit nbr
* the output needs to look like this: $cb->set("index", $randomnumber);
// THE CLASS DEFINITION FOR "$cb"
public function set($index, $randomnumber)
$this->data[$index] = $randomnumber;
// INSTANCE OF THE CB CLASS
$cb = new CB;
// RANGE OF TEN DIGIT NUMBERS
$lo = 1000000000;
$hi = 9999999999;
// NUMBER OF ELEMENTS TO CREATE
$lim = 32;
// STARTING INDEX
$ndx = 16;
// THE ARRAY KEYS
$arr = range($ndx, $ndx+$lim);
foreach ($arr as $key)
$cb->set($key, rand($lo, $hi));
// SHOW THE WORK PRODUCT
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.