我试图让 if 语句回显内联样式。但是我只能让我的条件在任何 1 个数字上返回 true,而不是数组,|| 分开等...
你能解释一下如何制作|| version 和一个数字数组在我的条件下返回 true。
// Works.
$counts = 0 ;
foreach ($posts as $post) : setup_postdata($post); $counts++;
if ($counts == 8) {echo 'counts equals your numbers';}
endforeach;
// This does nothing.
$numbers = array(4,8);
$counts = 0 ;
foreach ($posts as $post) : setup_postdata($post); $counts++;
if ($counts == $numbers) {echo 'counts equals your numbers';}
endforeach;
// Returns true for every iteration.
$counts = 0 ;
foreach ($posts as $post) : setup_postdata($post); $counts++;
if ($counts == 4 || 8) {echo 'counts equals your numbers';}
endforeach;