Hello:
I'm using array_multisort() to attempt to sort my multidimensional array but I can't get it to work right. The examples on php.net don't seem to fit what I'm doing or I can't seem to apply it correctly.
Here's an example of my array:
<?php $stateList = array( array ( Location => "Alabama",
array( Territory => "Baldwin County",
Publisher => "Midway Publishing, LLC",
Phone => "251-555-1212",
Website => "http://test.com"
),
array( Territory => "Butler County",
Publisher => "Grey-Wells Publishing",
Phone => "555-555-2121",
Website => "http://test.com"
),
array( Territory => "Crenshaw County",
Publisher => "Grey-Wells Publishing",
Phone => "334-555-3232",
Website => "http://test.com"
)
Of course, these are currently in ABC order but they won't always be from here on out.
I have a loop ($a) to run through Location (currently only showing Alabama above) and then a loop inside that ($b) to show the counties.
Here's my attempt at array_multisort():
$sortCountyABC = array_multisort($stateList[$a]["Loction"], SORT_ASC);
print_r($sortCountyABC);
Every way I try nothing works!
I get:
Warning: array_multisort() [function.array-multisort]: Argument #1 is expected to be an array or a sort flag in /home/tidbitsnet/domains/tidbitsweekly.net/public_html/tidbits_locations.php on line 2
Any ideas?
Thanks!