Hello I would like to sort my 3d array by the key "Value" then echo out the response. This is for a fraction game where people are suppose to place the fractions in order i have the fractions being generated but I need to echo out the array part by part like echo $data[0].
$data = array( array('Value' => $even, 'PartA' => $Part1A, 'PartB' => $Part1B), array('Value' => $even2, 'PartA' => $Part2A, 'PartB' => $Part2B), array('Value' => $even3, 'PartA' => $Part3A, 'PartB' => $Part3B), array('Value' => $even4, 'PartA' => $Part4A, 'PartB' => $Part4B), array('Value' => $even5, 'PartA' => $Part5A, 'PartB' => $Part5B) ); // function makeSortFunction($field) // { // $code = "return strnatcmp(\$a['$field'], \$b['$field']);"; // return create_function('$a,$b', $code); // } // usort($data, makeSortFunction('Value')); sort($data); var_dump($data); echo "test" . $data[0][0] . "test";