Home  >  Article  >  Backend Development  >  for出解决思路

for出解决思路

WBOY
WBOYOriginal
2016-06-13 12:37:22765browse

for出


function Call_css($str,$cid){
$as= explode(",", $str);
foreach ((array)$as as $Name) {
$IDcss = explode(":", $Name);
if($IDcss[0]==$cid){
echo $IDcss[1]."
";
}else{
echo $cid."---
";
}
}

}

for($i=1;$i Call_css("5:TG1,6:TG2,11:TG3,12:TG44",$i);

}
?>

怎样做到这样
1---
2---
3---
4---
TG1
TG2
7--
8--
9--
10--
TG3
TG44

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn