Jump to content

Array Sorting


sandstorm140

Recommended Posts

I'd like to be able to sort an array by one of the 3 values (username, joindate, or last_login) before it gets echod off. using ksort($value[2]); or something that would work.

How can I go about doing this?

 

while ($row[67] = mysql_fetch_assoc($result[67])) {
	$rowRe[] = array(1=>$row[67]['username'], $row[67]['joindate'], $row[67]['last_login']);
}

foreach ($rowRe as $value) {
	echo('
		<tr align="left" class="accountinfo">
			<td align="center">' . $iii++ . '</td>
		 	<td>' . $value[1] . '</td>
		 	<td align="center">' . substr($value[2], 0, -9) . '</td>
			<td align="left" colspan="7">' . substr($value[3], 0, -9) . '</td>
		</tr>');	
}

Link to comment
https://forums.phpfreaks.com/topic/147552-array-sorting/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.