A couple of days back I encountered the following request on a forum for sorting a single dimensional array. The programmer wanted to sort the following array by the substring after the colon. For example ‘CDF’ in the string ‘66345:CDF’. Those values that do not have any colon should be ignored and pushed to the end of the array. Also, the length of the strings are not constant.
$values = array("66345:CDF", "61179:HGT", "64146:ABA",
"68768:BNG", "68015:ZCZ", "80231:LPO",
"64146:QWP", "68736:HHB", "86801:MNV",
"80178:OIU", "80178:ASE", "88178:BRT",
"801782OIU", "801378ASE", "881578BRT");