日期:2014-05-17 浏览次数:20772 次
<?php
//$meb['learned']数据库取值为:排舞,街舞,主持人,讲师
$learn = explode(',',$meb['learned']);
//echo $learn[0].$learn[1].$learn[2].$learn[3].$learn[4].$learn[5];
$strp = str_replace(',', '", "', $meb['learned']);
$strp2 = '"'.$strp.'"';
$people = array($strp2);
print_r($people);
//以上输出结果为 Array ( [0] => "排舞", "街舞", "主持人", "讲师" )
if (in_array('讲师',$people)){
echo "Match found";
}
else
{
echo "Match not found";
}
?>