------解决方案--------------------$s = '0,48423,48425,48427,48419,48413,48415,48417,48418,48414,48416,48411,';<br />
<br />
echo preg_replace('/\d+,((?:\d+,){3}\d+).*/', '$1', $s);<br />
Copier après la connexion
------解决方案--------------------$string = "0,48423,48425,48427,48419,48413,48415,48417,48418,48414,48416,48411,";<br />
$ar=explode(',',$string);<br />
$arr=array_slice($ar,1,4);<br />
echo join(',',$arr);
Copier après la connexion
------解决方案--------------------<br />
$str="0,48423,48425,48427,48419,48413,48415,48417,48418,48414,48416,48411,";<br />
function jiequ($str,$a,$b){<br />
$ar=explode(",",$str);<br />
for($i=$a;$i<$b;$i++){<br />
$br[]=$ar[$i];<br />
}<br />
return implode(",",$br);<br />
}<br />
echo jiequ($str,1,5);//1和5表示截取第一个,和第5个,之间的数<br />
Copier après la connexion