Use below code:-
$result = [];
foreach($MainArray as $record){
$result[$record['Machine_Name']][] = $record;
}
More Related Contents:
- PHP multidimensional array search by value
- How to sum all column values in multi-dimensional array?
- How to search by key=>value in a multidimensional array in PHP
- PHP foreach change original array values [duplicate]
- Passing arrays as url parameter
- Are arrays in PHP copied as value or as reference to new variables, and when passed to functions?
- PHP Multiple Checkbox Array
- glob() – sort array of files by last modified datetime stamp
- PHP – Accessing Multidimensional Array Values
- How to get single value from this multi-dimensional PHP array
- Convert array of single-element arrays to a one-dimensional array
- Type hinting – specify an array of objects
- Convert an associative array to a simple array of its values in php
- Posting array from form
- CSV to Associative Array
- Check if a specific value exists at a specific key in any subarray of a multidimensional array
- How to pass an array via $_GET in php?
- How to get common values from two different arrays in PHP [closed]
- Comment associative array in PHP Documentor
- Get the maximum value from an element in a multidimensional array? [duplicate]
- Move an array element to a new index in PHP
- How do I declare a two dimensional array?
- PHP get all arguments as array?
- Convert PHP array string into an array
- Change array key without changing order
- Moving array element to top in PHP
- Recursive array_search
- phpexcel Allowed memory size of 134217728 bytes exhausted [duplicate]
- Check if all values in array are the same
- PHP, pass array through POST