I would like to sort only the "Name" value on a table but it doesn't seem to work.
$fruits = array(
array(
'image' => '<img class="img" src="papaya.jpg">',
'name' => 'Papaya',
'description'=> 'Color: Yellow',
),
array(
'image' => '<img class="img" src="blueberry.jpg">',
'name' => 'Blueberry',
'description'=> 'Color: Blue',
),
array(
'image' => '<img class="img" src="orange.jpg">',
'name' => 'Orange',
'description'=> 'Color: Orange',
),
);
array_multisort($fruits['name'], SORT_ASC);
I wanted the output to be like this:
| Image | Name | Description |
|---|---|---|
| pic | Blueberry | Color: Blue |
| pic | Orange | Color: Orange |
| pic | Papaya | Color: Yellow |
usortwith a custom callback?