Home
|
About
|
Last
|
Submit
|
Contact
Real-time counter
Question
sort problem
( SitePoint Forums PHP )
Updated: 2008-11-23 05:25:01 (2)
sort problem
OK the problem I'm having is as follows:
If i have files named 001.jpg, 002.jpg ... 010.jpg, 011.jpg, it will sort those into the correct order.
Now if i have files named 1.jpg, 2.jpg ... 10.jpg, 11.jpg it will order them as follows:
1.jpg, 10.jpg, 11.jpg, 2.jpg ...
How can i get around this so it orders them in a numerical order?
Answers:
sort problem
( SitePoint Forums PHP )
sort problem
haha nevermind.
natsort() saves the day.
CHeeSeBLiND
sort problem
Try to add SORT_NUMERIC flag when you call sort(), e.g sort($array, SORT_NUMERIC)
http://sg2.php.net/manual/en/function.sort.php
battra
- Source:
sort problem SitePoint Forums PHP
- Previous Question:
Feeler Apple Store Bayshore Grand Opening t shirt
Mac Forums Marketplace Archive
- Next Question:
How to make search form centered
SitePoint Forums CSS
website statistics