これを短く書く方法はありますか?
<?
if($_GET['id']==1 ||
$_GET['id']==3 ||
$_GET['id']==4 ||
$_GET['id']==5)
{echo 'does it really have to be this explicit?'};
?>
もしかしてこういうこと?
<?
if($_GET['id']==1 || 3 || 4 || 5){echo 'this is much shorter'};
?>
これを短く書く方法はありますか?
<?
if($_GET['id']==1 ||
$_GET['id']==3 ||
$_GET['id']==4 ||
$_GET['id']==5)
{echo 'does it really have to be this explicit?'};
?>
もしかしてこういうこと?
<?
if($_GET['id']==1 || 3 || 4 || 5){echo 'this is much shorter'};
?>