Array to skal sættes sammen men det ser ikke helt rigtigt ud, skal have mulighed for at sortere
HejHar et problem med dette:
To array skal sættes sammen men det ser ikke helt rigtigt ud, skal have mulighed for at sortere.
Vil meget gerne sortere på $dateToArray Så jeg får de rigtige datoer.
//Numbers
$count = get_option( 'next_top_count_' );
$number = range(0, $count);
$numberToString = implode(', ', $number);
$countToArray = explode(', ', $count);
$replacement = ", ";
foreach ($countToArray as $number) {
$count = get_option( 'next_top_count_' );
$number = range(0, $count);
$numberToString = implode(', ', $number);
$numberToArray = explode(', ', $numberToString);
$replacementNumber = substr_replace($number, $replacement, 0, 0);
foreach($numberToArray as $dateCount) {
$dateToArray[$dateCount] = explode(', ', strtotime(get_option( 'teenstyle_top_banner_name_top_start_date'.$dateCount.'' )));
$dateToArraystring = implode(', ', $dateToArray);
$dateToString = implode(', ', $dateToArray);
$replacementDate = substr_replace($dateToString, $replacement, 0, 0);
}
array_multisort($numberToArray, SORT_DESC, SORT_REGULAR);
$combineArrayCombine = array_combine($numberToArray, $dateToArray);
var_dump($combineArrayCombine);
};
foreach ($numberToArray as $next_variable) {
Output:
0 =>
array (size=1)
0 => string '1574812800' (length=10)
1 =>
array (size=1)
0 => string '1572393600' (length=10)
2 =>
array (size=1)
0 => string '1571788800' (length=10)
3 =>
array (size=1)
0 => string '1572307200' (length=10)
4 =>
array (size=1)
0 => string '1572566400' (length=10)
5 =>
array (size=1)
0 => string '1572480000' (length=10)
Med venlig hilsen
Morten