Sort an array using PHP with selection sort and singular linear scan methods