<?php
$GLOBALS['test'] = [
['id' => 30009, 'url' => 333222],
['id' => 33351, 'url' => 555666],
];
function my_array_rand($array) {
static $i = 0;
return $keys[$i++ % count($array)]; }
for ($i = 0; $i < 3; $i++) {
var_dump($GLOBALS['test'][my_array_rand
($GLOBALS['test'])]); }
PD9waHAKCiRHTE9CQUxTWyd0ZXN0J10gPSBbCiAgWydpZCcgPT4gMzAwMDksICd1cmwnID0+IDMzMzIyMl0sCiAgWydpZCcgPT4gMzMzNTEsICd1cmwnID0+IDU1NTY2Nl0sCl07CiAgCmZ1bmN0aW9uIG15X2FycmF5X3JhbmQoJGFycmF5KSB7CiAgICBzdGF0aWMgJGkgPSAwOwogICAgJGtleXMgPSBhcnJheV9rZXlzKCRhcnJheSk7CiAgICByZXR1cm4gJGtleXNbJGkrKyAlIGNvdW50KCRhcnJheSldOwp9Cgpmb3IgKCRpID0gMDsgJGkgPCAzOyAkaSsrKSB7Cgl2YXJfZHVtcCgkR0xPQkFMU1sndGVzdCddW215X2FycmF5X3JhbmQoJEdMT0JBTFNbJ3Rlc3QnXSldKTsKfQo=