Why is it not sorting my array appropriately?
ksort()
works on the array directly and returns a bool - returning true
on success and false
otherwise.
print_r()
outputs 1
(i.e. true
) because ksort()
successfully sorted the array.
Don't reassign $array
.