//JS: 获取字符串第一位 var a = test; console.log(a[0]);//t //PHP:获取字符串第一位 var a = test; echo substr($a,0,1);//t