note 48402 added to function.uksort

From: Date: Wed, 22 Dec 2004 12:35:31 +0000
Subject: note 48402 added to function.uksort
Groups: php.notes 
Request: Send a blank email to php-notes+get-82173@lists.php.net to get a copy of this message
One remark regarding array_sorter class. It won't work correctly with eg. dates from mysql like 20041206105350, cause you can't convert such number into integer. To fix it remove intval() from the code. If the variable is a number it will work without converting this to int anyways. Here is the fix. <?php .... if ($a == $b) return 0; if ($this->sasc) return ($a > $b) ? 1 : -1; else return ($a > $b) ? -1 : 1; ... ?> ---- Manual Page -- http://www.php.net/manual/en/function.uksort.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+48402 Delete -- http://master.php.net/manage/user-notes.php?action=delete+48402&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48402&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48402&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48402&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48402&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48402&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+48402&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#82173) next »