I am writing a sort function (using usort), and part of the operation I want to do there is determining which value comes first alphabetically. (This is only part of the operation, hence I'm not using natsort.) This means I have two strings for which I need to determine which is alphabetically first. Since this operation gets done in a loop, I want to have this done as simple as possible. One thing I could do is construct an array out of the two elements and use natsort on that. Is there a better approach, that does not involve constructing an array from the two values?
Edit: $a > $b
seems to get basic cases right, though I'm not sure of how correct this behaves.