Javascript to PHP domain.charCodeAt(i)
<p>I'm trying to convert a javascript snippet into PHP.
Javascript is </p>

<pre><code>var sum1 = 0, sum2 = 0;
for (var i = domain.length - 1; i &gt;= 0; i--) {
    sum1 += domain.charCodeAt(i) * 13748600747;
    sum2 += domain.charCodeAt(i) * 40216416130;
}

var x = ("$" + sum1).substring(0, 8) + ("" + sum2).substring(0, 8);
</code></pre>

<p>But couldn't understand this part, <code>sum1 += domain.charCodeAt(i) * 13748600747;</code> I mean which PHP function can be used instead of domain.charCodeAt(i).</p>

<p><strong>EDIT:</strong></p>

<p>My PHP code:</p>

<pre><code>$domain = "example.com";
$sum1 = 0;
$sum2 = 0;
$length = strlen($domain);
$i = $length - 1;
for ( $i; $i &gt;= 0; $i-- ) {
    $sum1 += ord($domain[$i]) * 13748600747;
    $sum2 += ord($domain[$i]) * 40216416130;
}
$newsum = "$".$sum1;
$x = substr($newsum,0,8) + substr($sum2,0,8);

echo $x;
</code></pre>

<p>Output is definitely different. Need Help.</p>
