Sorry for the late response, thanks for your comment!
You are right, spaceship is a great choice for this case, and it's mentioned in the referenced SO from the intro of the post.
But, take a look at the conclusion from the post - "Copy-pasting solutions from Stack Overflow without enough research can result in big damage." Hope this answers your question :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello,
Why don't you use
strnatcmp
: php.net/manual/en/function.strnatc... ?or directly
<=>
operator?Sorry for the late response, thanks for your comment!
You are right, spaceship is a great choice for this case, and it's mentioned in the referenced SO from the intro of the post.
But, take a look at the conclusion from the post - "Copy-pasting solutions from Stack Overflow without enough research can result in big damage." Hope this answers your question :)