I'm using the following code to sort incremental content by number (Week 1, Week 2, Week 3, etc) and it has worked fine until I hit Week 10 then it started ordering it like this: Week 1, Week 10, Week 11, Week 2, Week 3, etc.) I can't for the life of me figure out how to fix this and was hoping someone here could help me out? PHP: <?php session_start(); function cmp($a, $b) { if ($a['link_url'] == $b['link_url']) { return 0; } return ($a['link_url'] < $b['link_url']) ? -1 : 1; } if ($_SESSION['_amember_links']) { usort($_SESSION['_amember_links'],'cmp'); foreach ($_SESSION['_amember_links'] as $link_id => $link) { if($link['link_group_id'] == "0" && preg_match("/\bIntensive\b/i", $link['link_title'])) { echo "<a href=\"".$link['link_url']."\"><font face=\"Arial\" size=\"5\">".$link['link_title']."</font></a><br><br>"; } } } ?>
As I can see from code you sort by urls and not by titles, What url format you use? This will be possible to modify function cmp($a, $b) and sort depending on url format.