How to execute same block of codes for multiple cases of Switch statement in PHP
<?php
$day = 'Saturday';
switch($day)
{
case 'Saturday':
case 'Sunday':
echo 'It\'s a weekend';
break;
default:
echo 'Not a weekend';
break;
}
?>
$day = 'Saturday';
switch($day)
{
case 'Saturday':
case 'Sunday':
echo 'It\'s a weekend';
break;
default:
echo 'Not a weekend';
break;
}
?>
Comments
Post a Comment