function assoc_title($arr, $key)
{
$tmp_arr = array();
foreach ($arr as $k => $v) {
if (in_array($v[$key], $tmp_arr)) {
unset($arr[$k]);
} else {
$tmp_arr[] = $v[$key];
}
}
return $arr;
}//assoc_title end
$key_title = 'stu_name';
$quchong = assoc_title($teachers, $key_title);
echo "<table border=\"1\" bordercolor=\"#CCCCCC\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse:collapse\" width=\"20%\">";
echo "<tr><td>id</td><td>学生名</td><td>电话</td></tr>";
$i = 1;
foreach ($quchong as $key => $vale) {
if ($vale['stu_name'] == "游开琳" or $vale['stu_name'] == "韩建通") {
continue;
}
echo "<tr><td>{$i}</td><td>{$vale['stu_name']}</td><td>{$vale['tel']}</td></tr>";
$i++;
}
echo "</table>";
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