JS コードを PHP コードに変換
<script type="text/javascript"><br /> function rightSide(playerID) {<br /> this.Decrypt2 = function(data) {<br /> var b = (7 * (data - 6) % 10 + 10) % 10;<br /> return b.toString();<br /> alert(b.toString());<br /> }<br /> <br /> this.Decrypt = function(playerID) {<br /> playerID = playerID.toString();<br /> var arrID = new Array();<br /> for (var i = 0; i < playerID.length; i = i + 1) {<br /> var a = playerID.substr(i, 1);<br /> <br /> switch (a) {<br /> case "0": arrID.push(this.Decrypt2(0)); break;<br /> case "4": arrID.push(this.Decrypt2(1)); break;<br /> case "5": arrID.push(this.Decrypt2(2)); break;<br /> case "3": arrID.push(this.Decrypt2(3)); break;<br /> case "6": arrID.push(this.Decrypt2(4)); break;<br /> case "9": arrID.push(this.Decrypt2(5)); break;<br /> case "7": arrID.push(this.Decrypt2(6)); break;<br /> case "1": arrID.push(this.Decrypt2(7)); break;<br /> case "2": arrID.push(this.Decrypt2(8)); break;<br /> case "8": arrID.push(this.Decrypt2(9)); break;<br /> }<br /> }<br /> return arrID.join('');<br /> }<br /> return this.Decrypt(playerID);<br /> } <br /> var idArr = rightSide(5705);