# 我做了一个while循环，但是最后一次循环不需要加最后的一个逗号，

while(strpos(\$ssc,”2017″)) {

echo ‘{“expect”:”‘.substr(\$ssc,strpos(\$ssc,”2017″),11).” “.'”,”opentime”:”‘.substr(\$ssc,strpos(\$ssc,”2017″)+50,18).” “.

‘”,”opencode”:”‘.

substr(\$ssc,strpos(\$ssc,”2017″)+107,1).” “.

substr(\$ssc,strpos(\$ssc,”2017″)+147,1).” “.

substr(\$ssc,strpos(\$ssc,”2017″)+187,1).” “.

substr(\$ssc,strpos(\$ssc,”2017″)+227,1).” “.

substr(\$ssc,strpos(\$ssc,”2017″)+267,1).’},’;

\$ssc=substr(\$ssc,strpos(\$ssc,”2017”)+1700);

}

\$ssc = substr(\$ssc, 0, -1);

\$ssc = substr(\$ssc, 0, -1);这个放在那里啊

\$a = ”;
while(strpos(\$ssc,”2017″)) {
\$a .= ‘{“expect”:”‘.substr(\$ssc,strpos(\$ssc,”2017″),11).” “.'”,”opentime”:”‘.substr(\$ssc,strpos(\$ssc,”2017″)+50,18).” “.
‘”,”opencode”:”‘.
substr(\$ssc,strpos(\$ssc,”2017″)+107,1).” “.
substr(\$ssc,strpos(\$ssc,”2017″)+147,1).” “.
substr(\$ssc,strpos(\$ssc,”2017″)+187,1).” “.
substr(\$ssc,strpos(\$ssc,”2017″)+227,1).” “.
substr(\$ssc,strpos(\$ssc,”2017″)+267,1).’},’;
\$ssc=substr(\$ssc,strpos(\$ssc,”2017”)+1700);
}
\$a = substr(\$a,0,-1);
echo \$a;

Posted in 未分类