- var_dump: documentation ( source)
- strspn: documentation ( source)
<?php
$string1 = 'The lazy cat jumps over the fast fox.';
$string2 = 'The fast fox jumps over the lazy cat.';
$xor = $string1 ^ $string2;
var_dump($xor);die();
$pos=0;$len=strlen($xor);
while($pos<$len) {
$pos=strspn($xor,"\0",$pos);
print 'Diff @'.$pos.' String1:'.$string1[$pos].' String2:'.$string2[$pos].'<br>';
$pos++;
}