<?php
$array = array(
array('date'=>'2014-12-01', 'price'=>'123.00'),
array('date'=>'2013-12-01', 'price'=>'123.00'),
array('date'=>'2014-02-01', 'price'=>'123.00'),
array('date'=>'2014-03-01', 'price'=>'123.00'),
)
function sortByDate($a, $b) {
return $a['date'] - $b['date'];
}
usort($array, 'sortByDate');
var_dump($array);
- Output for 5.4.0 - 5.4.26
- Parse error: syntax error, unexpected 'function' (T_FUNCTION) in /in/6ovt2 on line 8
Process exited with code 255. - Output for 5.3.0 - 5.3.28
- Parse error: syntax error, unexpected T_FUNCTION in /in/6ovt2 on line 8
Process exited with code 255.
preferences:
185.21 ms | 1398 KiB | 64 Q