I have a multi dimension array that looks like the clip below. There are multiple regions (Eastern, Western, Southern, etc). Any given salesman could have sales on a given month in multiple regions, and may or may not have sales every month.
I'm trying to figure out how to sort the whole array alphabetically by salesman name, so when I output into a table (broken up by each region), whatever salesmen are in the region will appear alphabetically. I can't seem to wrap my brain around multi_sort function. Can someone demonstrate how to do this?
$report[region][salesman][period]=amount
Array
(
[Eastern] => Array
(
[Billy] => Array
(
[May 2015] => 0.4
[Apr 2015] => 10369.83
[Mar 2015] => 24451.03
[Feb 2015] => 130932.39
[Jan 2015] => 67814.1
[Dec 2014] => 34325.84
[Nov 2014] => 184135.58
[Oct 2014] => 281384.17
[Sep 2014] => 48409.86
[Aug 2014] => 29151.70
[Jul 2014] => 136390.90
[Jun 2014] => 239487.05
)
[Dan] => Array
(
[May 2015] => 182881.50
[Apr 2015] => 87234.68
[Mar 2015] => 2852.43
[Feb 2015] => 415733.98
[Jan 2015] => 359703.35
[Dec 2014] => 357160.22
[Nov 2014] => 974288.1
[Oct 2014] => 42582.95
[Sep 2014] => 508902.93
[Aug 2014] => 935905.02
[Jul 2014] => 74179.12
[Jun 2014] => 442272.34
)
[jille] => Array
(
[Jan 2015] => 395.75
)
[jim] => Array
(
[Dec 2014] => 2920.4
)
[doug] => Array
(
[Nov 2014] => 0.4
)
[sean] => Array
(
[Nov 2014] => -4894.12
[Oct 2014] => 91454.83
[Sep 2014] => 9751.02
[Aug 2014] => 984.72
[Jul 2014] => 24230.25
[Jun 2014] => -816.99
)
[BrentC] => Array
(
[Oct 2014] => 0.4
[Aug 2014] => -2895.12
)
[Will] => Array
(
[Sep 2014] => 2895.12
)