------解决方案--------------------$s = '0,48423,48425,48427,48419,48413,48415,48417,48418,48414,48416,48411,';
echo preg_replace('/\d+,((?:\d+,){3}\d+).*/', '$1', $s);
------解决方案--------------------$string = "0,48423,48425,48427,48419,48413,48415,48417,48418,48414,48416,48411,";
$ar=explode(',',$string);
$arr=array_slice($ar,1,4);
echo join(',',$arr);
------解决方案--------------------
$str="0,48423,48425,48427,48419,48413,48415,48417,48418,48414,48416,48411,";
function jiequ($str,$a,$b){
$ar=explode(",",$str);
for($i=$a;$i $br[]=$ar[$i];
}
return implode(",",$br);
}
echo jiequ($str,1,5);//1和5表示截取第一个,和第5个,之间的数
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
相关文章
相关视频
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论