I have one big array which has a load of similar values but I want to put all the arrays with the same value into another array. For example, I have this array.
    array(4) {
      [0]=>
      array(8) {
       ["symbol"]=>
        string(3) "aaaa"
        ["name"]=>
        string(7) "aaaa"
        ["buy_price"]=>
        string(14) "100.0000000000"
        ["current_worth"]=>
        string(14) "100.2500000000"
      }
      [3]=>
      array(8) {
       ["symbol"]=>
        string(3) "aaa"
        ["name"]=>
        string(7) "aaaaa"
        ["buy_price"]=>
        string(14) "100.0000000000"
        ["current_worth"]=>
        string(14) "100.2500000000"
      }
      [2]=>
      array(8) {
       ["symbol"]=>
        string(3) "xxx"
        ["name"]=>
        string(7) "xxxxx"
        ["buy_price"]=>
        string(14) "100.0000000000"
        ["current_worth"]=>
        string(14) "100.2500000000"
      }
   }
I want to be able run this array through a foreach loop and then output the array results together that all have the same name. Like too
- Name aaa -- Name aaa [0] -- Name aaa [1] 
- Name xxx -- Name xxx [0] 
I am struggling how to do the logic.
 
    