I want to print one key & value at a time (from first to last). After passing random amount of seconds (let's say from range 1 to 10) print another key & value than another delay and print, delay and print (till the end of array). I don't want dupliacate print of the same records.
script prints: key1, value 1
make random delay: (for ex.) 5 seconds
than prints: key 2, value 2
make another random delay: (for ex.) 3 seconds
than prints: key 3, value 3
foreach ($test_array as $key => $value)
echo $key . "=>" . $value; //print out the values
$iWait = rand(1,10); //randomize the seconds to wait, between 1 to 10
sleep($iWait); //execute the waiting part.
Do check and read the PHP Manual. It can be downloaded from www.php.net
High level languages do have basic functions that are quite easy to guess, just look up the functions from common sense.