这是您的PHP代码的直接转换://Loading the variablevar mystr = '0000000020C90037:TEMP:data';//Splitting it with : as the separatorvar myarr = mystr.split(":");//Then read the values from the array where 0 is the first//Since we skipped the first element in the array, we start at 1var myvar = myarr[1] + ":" + myarr[2];// Show the resulting valueconsole.log(myvar);// 'TEMP:data'