note 106761 added to function.usort
| From: | admin at web31 dot eyhost dot cn | Date: | Mon, 05 Dec 2011 04:58:38 +0000 |
| Subject: | note 106761 added to function.usort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184897@lists.php.net to get a copy of this message | ||
sort multi-dimentional arrays in class with usort
<?php
class ArraySort
{
private $arr = array();
public function __construct($arr)
{
$this->arr = $arr;
}
public function doSort()
{
$cmp = function($a, $b)
{
//Do Some Comparation
}
if(is_array($this->arr))
{
usort($this->arr, $cmp);
}
return $this->arr;
}
}
?>
----
Server IP: 203.169.204.174
Probable Submitter: 114.134.80.148
----
Manual Page -- http://www.php.net/manual/en/function.usort.php
Edit -- https://master.php.net/note/edit/106761
Del: integrated -- https://master.php.net/note/delete/106761/integrated
Del: useless -- https://master.php.net/note/delete/106761/useless
Del: bad code -- https://master.php.net/note/delete/106761/bad+code
Del: spam -- https://master.php.net/note/delete/106761/spam
Del: non-english -- https://master.php.net/note/delete/106761/non-english
Del: in docs -- https://master.php.net/note/delete/106761/in+docs
Del: other reasons-- https://master.php.net/note/delete/106761
Reject -- https://master.php.net/note/reject/106761
Search -- https://master.php.net/manage/user-notes.php