PHP to Javascript

AWARDED
Bids
2
Avg Bid (PHP)
545 / hr
Project Budget (PHP)
₱90 - ₱90 / hr

Project Description:
I require the following function to be changed into PHP if it is possible so that I can generate the same results in PHP that this javascript runs.

Code:

<script>
function FormTypeABTester(u){
var g=16;
var h=32;
var a=65;
var i=90;
var j=48;
var b=57;
var c=58;
var d=63;
var e=91;
var f=94;
var t=0;
var w=0;
var za=0;
var z=0;
var o=[];
var p=null;
var k=[];
var s=[];
var r=[];
var q=[];

for(var m=0;m<10;m++){
k.push(0);s.push(0);
}
for(var n=0;n<10;n++){
s.push(0);r.push(0);q.push(0);
}
var x=function(zb){
var ze=window.event?new Date().getTime():zb.timeStamp;
var zc=window.event?window.event.keyCode:zb.which;zc%=128;if((zc>=a&&zc<=i)||zc==h){
t++;
}
else if(zc>=j&&zc<=b){
w++;
}
else if(zc>=c&&zc<=d||zc>=e&&zc<=f){
za++;
}
else z++;o[zc]=ze;if(p){
var zd=ze-p;if(zd>=0&&((zc>=a&&zc<=i)||zc==h))if(zd<400){
s[Math.floor(zd\/20)]++;
}
else if(zd<1000){
r[Math.floor((zd-400)\/60)]++;
}
else if(zd<3000)q[Math.floor((zd-1000)\/200)]++;
}
p=ze;
};
var y=function(zc){
var ze=window.event?new Date().getTime():zc.timeStamp;
var zd=window.event?window.event.keyCode:zc.which;
var zb=ze-o[zd%128];if(zb>=50&&zb<250)k[Math.floor((zb-50)\/20)]++;
};
var v=function(zb){
var zd=Math.max.apply(Math,zb);
var zc=[];zb.each(function(ze){
zc.push(Math.floor(ze*64\/(zd||1)));
}
);
return zc;
};
var l=function(){
var zb=s.concat(r,q);return v(zb).concat(v(k),[t\/2,w\/2,za\/2,z\/2]);
};
this.getData=function(){
return Base64.encodeNums(l());
};
Event.listen(u,{keyup:y.bind(this),keydown:x.bind(this)
}
);
}
function startFormTypeABTester(a){
a.ab_tester=new FormTypeABTester(document);
}
function setFormTypeABTest(a){
a.ab_test_data.value=a.ab_tester.getData();return true;
}
</script>

Hours of work: 1 hour / week Project Duration: < 1 week Skills required:
PHP
Hire oc101
Project posted by:
oc101 United States
Verified
Public Clarification Board
Bids are hidden by the project creator. Log in as the project creator or as one of the bidders to view bids.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.