If I have the following array:
$array = array(
"01" => "0",
"02" => "0",
"03" => "0",
"04" => "0",
"05" => "0",
"06" => "0",
"07" => "0",
"08" => "0",
"09" => "0",
"10" => "0",
"11" => "0",
"12" => "0"
);
how can I order it to be like:
$array = array(
"05" => "0",
"06" => "0",
"07" => "0",
"08" => "0",
"09" => "0",
"10" => "0",
"11" => "0",
"12" => "0",
"01" => "0",
"02" => "0",
"03" => "0",
"04" => "0"
);
Or even better how to echo every value starting at a specific key and going back if needed?
EDIT
I ended up working it in a different way.
$first_value = 05;
$where_to_slice = $first_value + 0; // this is just to remove any leading 0 because the $first_value was being retrieved from a DB as 05.
$array_owner_data_1 =(array_slice($array_owner_data, $where_to_slice));
$array_owner_data_2 =(array_slice($array_owner_data, 0,$where_to_slice));
echo implode(", ", $array_owner_data_1);
echo ",";
echo implode(", ", $array_owner_data_2);
So now if I print both slices in succession I get the data ordered as I wanted.