如何查找多个 ID

How do I look for more than one ID

所有人都在使用 PHP 的这一点进行 pdf 打印,想知道是否有人可以帮助我?我希望删除名为 Flights & Location 的 ID,目前它仅适用于查找和删除位置

请看下面的片段:

foreach( $tabs as $tab ) {
  if(isset($_GET['type']) && $tab['id'] == 'location'){
  }else{
    $html .= '<tr><td  style="padding-top:15px; padding-bottom:15px; text-align:center; background:#b7b7b7;">';
    $html .= '<h5>' . $tab['title'] . '</h5>';
    $html .= '</td></tr>';
    $html .= '<tr><td  style="padding-top:20px; padding-bottom:20px; text-align:center;">';
    $html .= '<p>' . wpautop($tab['content']) . '</p>';
    $html .= '</td></tr>';
  }
}

只需添加到 IF 语句

if(isset($_GET['type']) && ($tab['id'] == 'location' || $tab['id'] == 'flights') ){
// note the brackets       ^                                                   ^

但请记住,在混合使用 AND 和 OR 时,根据您的意图或事情变得有点奇怪总是很好的括号