@ 2015-12-16T23:22:56Z <?php
<?php
$resdata = array(
array(
array(
"prefix" => 93,
"rate" => "0.172962000",
"destination" => "Afghanistan"
)
),
array(
array(
"prefix" => 9320,
"rate" => 0,
"destination" => "Afghanistan (ON-NET)"
)
),
array(
array(
"prefix" => 9350,
"rate" => 0,
"destination" => "Afghanistan (ON-NET)"
)
),
array(
array(
"prefix" => 935,
"rate" => "0.451478000",
"destination" => "Afghanistan (ON-NET)"
)
),
array(
array(
"prefix" => 9360,
"rate" => 0,
"destination" => "Afghanistan (ON-NET)"
)
)
);
function getRate($items, $prefix) {
while($prefix = $prefix/10) {
foreach ($items as $key => $value) {
if ($value[0]["prefix"] === (int)$prefix) {
return $value[0]["rate"];
}
}
}
return null;
};
foreach ($resdata as $key => $row) {
if($row[0]['rate'] === 0) {
$rate = getRate($resdata, $row[0]['prefix']);
if ($rate) {
$resdata[$key][0]['rate'] = $rate;
}
}
}
print_r($resdata);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 7.0.0 0.013 0.073 20.10 5.6.16 0.007 0.080 20.71 5.6.15 0.007 0.057 18.23 5.6.14 0.003 0.040 18.23 5.6.13 0.010 0.033 18.29 5.6.12 0.007 0.037 21.12 5.6.11 0.007 0.090 21.00 5.6.10 0.007 0.083 20.98 5.6.9 0.020 0.073 21.13 5.6.8 0.003 0.040 20.56 5.5.30 0.003 0.063 17.97 5.5.29 0.007 0.077 17.98 5.5.28 0.003 0.040 20.87 5.5.27 0.017 0.057 20.89 5.5.26 0.007 0.090 20.76 5.5.25 0.000 0.043 20.77 5.5.24 0.007 0.037 20.18
preferences:dark mode live preview
133.18 ms | 1398 KiB | 7 Q