-5
任何人都可以幫我把這個轉換成PHP嗎?如何將JavaScript轉換爲PHP代碼
var encoded = '';
var resnumber = 0;
for (v = 1; v <= evnumber; v++) {
var indcode = v + 'code';
var valcode = document.getElementById(indcode).value;
valcode = valcode.trim();
var indname = v + 'name';
var valname = document.getElementById(indname).value;
valname = valname.trim();
var indleague = v + 'league';
var valleague = document.getElementById(indleague).value;
valleague = valleague.trim();
var inddate = v + 'date';
var valdate = document.getElementById(inddate).value;
valdate = valdate.trim();
var indtime = v + 'time';
var valtime = document.getElementById(indtime).value;
valtime = valtime.trim();
var indnumb = v + 'numb';
var valnumb = document.getElementById(indnumb).value;
valnumb = valnumb.trim();
valnumb = parseInt(valnumb);
encoded = encoded + valcode + '<e>' + valname + '<e>' + valleague + '<e>' + valdate + '<e>' + valtime + '<e>' + valnumb + '<e>';
for (w = 0; w < valnumb; w++) {
var indtype = v + 'signe|' + w;
var valtype = document.getElementById(indtype).value;
valtype = valtype.trim();
var indodd = v + 'odd|' + w;
var valodd = document.getElementById(indodd).value;
valodd = valodd.trim();
encoded = encoded + valtype + '<e>' + valodd + '<e>';
resnumber++;
}
encoded = encoded + '|';
}
encoded = encoded + '<results>';
for (t = 0; t < resnumber; t++) {
encoded = encoded + '<res>';
}
我投票關閉這一問題作爲題外話,因爲堆棧是不是免費的代碼轉換服務。 –
JavaScript在客戶端(瀏覽器)上運行。 PHP在服務器上運行。他們不太適合取代彼此的功能。 –
Downvote明顯的「請爲我做我的作業」。 – metaColin