What kind of array is this?

array(2) { [0]=> array(2) { [“store”]=> string(10) “Aldi South” [0]=> string(10) “Aldi South” } [1]=> array(2) { [“store”]=> string(19) “Hy-Vee Williamsburg” [0]=> string(19) “Hy-Vee Williamsburg” } }

I tried to sort it unsuccessfully.

Turns out its a multidimensional array. Here’s the code I used to sort it:

`$array = $this->data;
foreach ($array as $key => $row) {
      $stores[$key]  = $row[0];
}
array_multisort($stores, SORT_ASC);
var_dump($stores);

Please excuse me for answering my own question.

3 Likes

No excusing necessary! Thanks for posting the solution, and glad you got it working. :slight_smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.