$ar = preg_split("//u", '真心', -1, PREG_SPLIT_NO_EMPTY);<br />$where =array();<br />foreach($ar as $v)<br /> $where[]=" 字段 like '%$v%'";<br /><br />$sql="select * from tt " ;<br />$sql .= empty($where) ? '' : ' where ' . join(' and ', $where); <br />echo $sql;