note 109456 added to function.sort

From: Date: Wed, 18 Jul 2012 19:39:48 +0000
Subject: note 109456 added to function.sort
Groups: php.notes 
Request: Send a blank email to php-notes+get-189290@lists.php.net to get a copy of this message
For some reason, it sees SORT_NATURAL and other flags as string instead of long ("sort() expects parameter 2 to be long, string given"). A workaround is simply using a number. I've found that passing 5 as the second argument does what I want: sort case-insensitive. Reading more comments, it seems natcasesort() also works. Just wanted to share this workaround, especially since there don't seem to be good google results for this error. ---- Server IP: 83.137.20.135 Probable Submitter: 2001:980:1f44:1:21f:d0ff:fe8e:8830 ---- Manual Page -- http://www.php.net/manual/en/function.sort.php Edit -- https://master.php.net/note/edit/109456 Del: integrated -- https://master.php.net/note/delete/109456/integrated Del: useless -- https://master.php.net/note/delete/109456/useless Del: bad code -- https://master.php.net/note/delete/109456/bad+code Del: spam -- https://master.php.net/note/delete/109456/spam Del: non-english -- https://master.php.net/note/delete/109456/non-english Del: in docs -- https://master.php.net/note/delete/109456/in+docs Del: other reasons-- https://master.php.net/note/delete/109456 Reject -- https://master.php.net/note/reject/109456 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#189290) next »