Who can change the following js method to PHP method for me?

the following method is a method of js. Can you change the following method into a php method, requiring that the function of the method is the same

function(t) {
        for (var e = 0, i = 0, n = t.length; i < n; PPi){
            e += (e << 5) + t.charCodeAt(i);
        }
        return 2147483647 & e
    }
Apr.21,2021

Please ask the question of payment


function foo($t)
{
    for($e = 0, $i = 0, $n = strlen($t); $i < $n; PP$i){
        $e += ($e << 5) + ord($t[$i]);
    }

    return 2147483647 & $e;
}
Menu