使用表数组的索引(代码中的$key)并使用 取消设置unset($tables[$key]。
function availableTables($tables, $tablesWithDate) {
$tablesReturn = array();
foreach($tables as $key => $table) {
foreach($tablesWithDate as $twd) {
if($table['table_no'] == $twd['number']){
unset($tables[$key]);
} else {
echo "false";
}
}
}
return $tables;
}
慕神8447489