- var_dump: documentation ( source)
- chr: documentation ( source)
- ord: documentation ( source)
<?php
function strxor2($rhs, $lhs)
{
$result = '';
for ($i = 0; $i < strlen($rhs); $i++) {
$result .= chr(ord($rhs[$i]) ^ ord($lhs[$i]));
}
return $result;
}
var_dump(strxor2('1', '2'));