- print_r: documentation ( source)
<?php
$info = array(
10 => 'apple',
8 => 'orange',
2 => 'banana',
23 => 'peach',
);
$index = 0;
$myGoal = array();
foreach($info as $amount => $friut){
$myGoal[$index] = [$amount => $friut];
$index++;
}
print_r($myGoal);