Sorting

2 posts by 2 authors in: Forums > CMS Builder
Last Post: April 13, 2010   (RSS)

Re: [kcmedia] Sorting

By Jason - April 13, 2010

Hi,

Try this. Near the top of the page, we're going to put in this code:
<?php
function callback($a, $b) {
global $key;
if ($a[$key] == $b[$key]) return 0;
return $a[$key] > $b[$key] ? 1 : -1;
}
?>

Next, right before this line:
<?php foreach ($learner_legalRecord['bikes'] as $upload): ?>
Put in this code:

<?php
$key = 'info3';
uasort($learner_legalRecord['bikes'], 'callback');
?>


Give this a try and let me know how it goes.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/