Jump to content

[SOLVED] i dont understand function natsort()


silverglade

Recommended Posts

i dont understand this function. why doesnt it display the days in their numerical order? any help greatly appreciated , thanks. derek

 

natsort($arrayname)

 

Sorts mixed string/number values in natural order.

For example, given an array with values day1, day5,

day11, day2, it sorts into the following order: day1,

day2, day5, day11. The previous sort functions sort

the array into this order: day1, day11, day2, day5.

No, its correct

read samshel post

 

"The previous sort functions sort" refers to sort()

 

 

normal sort will return

day1

day11

day2

day5

 

natsort should return them as

 

day1

day2

day5

day11

 

(which i think is happening as you mentioned). so what exactly is the problem?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.