英语翻译$cids = array-unique(explode(',',substr(str-replace(',0,

问题描述:

英语翻译
$cids = array_unique(explode(',',substr(str_replace(',0,',',',','.$cids),1,-1)));
解释一下destoon里面一句代码谢谢
1个回答 分类:综合 2014-11-30

问题解答:

我来补答
$c = str_replace(',0,', ',', ','.$cids); //将"," + $cids作为一个拼接后的字符串进行替换:",0," → ","
$b = substr($c, 1, -1); //上面操作后的结果从第一个字符起至字符串的结束作为下一步操作的输入
$a= explode(',', $b); //把上面的结果以逗号分解成若干个小子串,字串的集合作为下一步的输入
$cids=array_unique($a); //取出上一步的去重结果(移除数组中的重复的值,并返回结果数组)
 
 
展开全文阅读
剩余:2000
上一页:hfftbjhg