<?php
//save the values you used
$fruit = 'Orange';
$color = 'orange';
$shape = 'round';
$price = '£.6';
$array[] = array($fruit, $color, $shape, $price);
$fruit = 'Mango';
$color = 'yellow';
$shape = 'oval';
$price = '£.9';
$array[] = array($fruit, $color, $shape, $price);
$fruit = 'Apple';
$color = 'red ';
$shape = 'round ';
$price = '£.4';
$array[] = array($fruit, $color, $shape, $price);
//display the initial array
print_r($array);
/**
* define comparing function; it will be used to compare two elements of the array in the process of sorting it
*/
function my_cmp_func($a, $b)
{
return strcmp($a[3], $b[3]);//the price is on the key 3 in your arrays
}//end function my_cmp_func
usort($array, 'my_cmp_func');//call usort (or uasort if you want to keep the initial keys) using the function defined above as a parameter
print_r($array);//display the final array