note 109505 added to function.sort

From: Date: Mon, 23 Jul 2012 12:46:48 +0000
Subject: note 109505 added to function.sort
Groups: php.notes 
Request: Send a blank email to php-notes+get-189372@lists.php.net to get a copy of this message
@holdoffhunger at gmail dot com There is a lot easier way to accomplish same thing: //Released under WTFPL v2 //http://en.wikipedia.org/wiki/WTFPL $array_of_data = array("hello","php","is","awesome","1","1234","12","9"); $elems = count($array_of_data); for ($i=0;$i<$elems-1;$i++) { for ($j=$i+1;$j<$elems;$j++) { if (strlen($array_of_data[$i]) < strlen($array_of_data[$j])) { $tmp = $array_of_data[$i]; $array_of_data[$i] = $array_of_data[$j]; $array_of_data[$j] = $tmp; } } } ---- Server IP: 69.147.83.197 Probable Submitter: 93.87.17.146 ---- Manual Page -- http://www.php.net/manual/en/function.sort.php Edit -- https://master.php.net/note/edit/109505 Del: integrated -- https://master.php.net/note/delete/109505/integrated Del: useless -- https://master.php.net/note/delete/109505/useless Del: bad code -- https://master.php.net/note/delete/109505/bad+code Del: spam -- https://master.php.net/note/delete/109505/spam Del: non-english -- https://master.php.net/note/delete/109505/non-english Del: in docs -- https://master.php.net/note/delete/109505/in+docs Del: other reasons-- https://master.php.net/note/delete/109505 Reject -- https://master.php.net/note/reject/109505 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#189372) next »