找到你要的答案

Q:Sort array to get values in loop

Q:排序数组以获取循环中的值

I have below array

array(2) {
  [0]=>
  array(1) {
    ["download_subcategory_name"]=>
    string(17) "Application Forms"
  }
  [1]=>
  array(1) {
    ["download_subcategory_name"]=>
    string(21) "Service Related Forms"
  }
}

My problem is how to sort this array in loop to get values.

我有以下数组

array(2) {
  [0]=>
  array(1) {
    ["download_subcategory_name"]=>
    string(17) "Application Forms"
  }
  [1]=>
  array(1) {
    ["download_subcategory_name"]=>
    string(21) "Service Related Forms"
  }
}

我的问题是如何在循环中排序这个数组以得到值。

answer1: 回答1:

Just got the answer..

foreach($array as $values) {
    echo $values['download_subcategory_name'] , '<br/>';
}

刚刚得到答案。

foreach($array as $values) {
    echo $values['download_subcategory_name'] , '<br/>';
}
php  arrays  sorting