日期:2014-05-17 浏览次数:20455 次
$list=""; $car = array('name'=>array(0=>array('xm'=>'我是特别的'),1=>array('xm'=>'你好'), 2=>array('xm'=>'你好'), 3=>array('xm'=>'你好'))); if(!$car['name']){ $list='Nothing'; }else{ $i = 1; foreach($car['name'] as $nm) { if(strstr($list,$nm['xm']) && $i == 1) { $list = str_replace($nm['xm'],$nm['xm'].$i,$list); $list .= $nm['xm'].($i+1).','; $i++; }else{ if(strstr($list,$nm['xm'])) { $list .= $nm['xm'].($i+1); $i++; }else{ $list .= $nm['xm'].','; } } } }
$sql="SELECT * FROM table where table.title in ('$list') limit 0,10";