If I'm reading things correctly, strnatcmp and strnatcasecmp have "undefined" behaviour for sorting things that are equal. Is there any way to do the same sort of sorting, but ... preserve the existing order of equal items?

Er, I think I actually mean when used in conjunction with uasort().

Sign in to participate in the conversation
PHP Community on Mastodon

Open source. Open community. We are dedicated to building and enriching the PHP community. Join us!

Welcome to the PHP Community on Mastodon! We're a friendly little Mastodon instance providing a place for PHP developers to discuss topics related to PHP, as well as topics unrelated to PHP. First and foremost, we're about building community, and that doesn't always involve technical discussion, so feel free to go off-topic and have fun.

Before you get started, make sure you check out our code of conduct.

Thank you to Jakob Westhoff for allowing the use of the photograph "elePHPants walking through the light."