0
我想測試父母的多個ID。目前我正在測試父母ID爲23的父母,但我也想測試父母ID爲1389.我該怎麼做?測試帖子父母是否等於多個ID的
<?php if($post->post_parent!==23){ ?>scale-with-grid<? } ?>
我想測試父母的多個ID。目前我正在測試父母ID爲23的父母,但我也想測試父母ID爲1389.我該怎麼做?測試帖子父母是否等於多個ID的
<?php if($post->post_parent!==23){ ?>scale-with-grid<? } ?>
您可以使用此功能in_array
:
if(!in_array($post->post_parent, array(23, 1389)) ...
您正在尋找的邏輯或操作。 – SLaks