need identical string comparison function in php and java

Posted by steelbytes on Stack Overflow See other posts from Stack Overflow or by steelbytes
Published on 2010-03-26T03:08:45Z Indexed on 2010/03/26 3:13 UTC
Read the original article Hit count: 308

Filed under:
|
|

I have sorted list of strings that I move between php and java. to be able to bsearch on this data, I need the same comparison function.

any idea what string compare functions I can use that will always give the same result in both? eg php's strcmp() vs java's String.compareTo()

yes I know I could make my own string compare that does char by char carefully, but I was hoping there's a simple answer.

PS, don't care if case sensitive or not, as long as it is consistant.

© Stack Overflow or respective owner

Related posts about php

Related posts about java