<?php
include("arraySort.php");
$start_data = array(
array('first_name' => 'Raj', 'last_name' => 'Trivedi', 'age' => 26),
array('first_name' => 'Parul', 'last_name' => 'Trivedi', 'age' => 26),
array('first_name' => 'Rahul', 'last_name' => 'Trivedi', 'age' => 22),
array('first_name' => 'Raghuvansh', 'last_name' => 'Trivedi', 'age' => 22),
array('first_name' => 'Gaurav', 'last_name' => 'Trivedi', 'age' => 21),
array('first_name' => 'Garima', 'last_name' => 'Trivedi', 'age' => 17),
array('first_name' => 'Neha', 'last_name' => 'Agrawal', 'age' => 26),
array('first_name' => 'Shweta', 'last_name' => 'Agrawal', 'age' => 25),
array('first_name' => 'Iti', 'last_name' => 'Agrawal', 'age' => 24),
);
$arrSort = new sortMultiDiArray($start_data,'first_name','asc');
$returnArray = $arrSort->sortArray();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>+++++++++++ Sort MD Array +++++++++++</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<table border="0" width="100%">
<tr>
<td>
Array:
<?php
echo "<pre>";
print_r($start_data);
echo "</pre>";
?>
</td>
<td>
Array after sort First Name:
<?php
echo "<pre>";
print_r($returnArray);
echo "</pre>";
?>
</td>
</tr>
</table>
</BODY>
</HTML>
|