Given two equal-length strings, is there an elegant way to get the offset of the first different character?
The obvious solution would be:
for ($offs
string strpbrk ( string $haystack , string $char_list )
strpbrk() searches the haystack string for a char_list.
The return value is the substring of $haystack which begins at the first matched character. As an API function it should be zippy. Then loop through once, looking for offset zero of the returned string to obtain your offset.