I have the following code ...
<?php
// test
$item_101_product_title = "MGT-101";
$item_102_product_title = "MGT-102";
$item_103_product_title = "MGT-103";
$item_104_product_title = "MGT-104";
$item_105_product_title = "MGT-105";
$item_106_product_title = "MGT-106";
$item_107_product_title = "MGT-107";
$item_108_product_title = "MGT-108";
$item_109_product_title = "MGT-109";
$item_110_product_title = "MGT-110";
$item_111_product_title = "MGT-111";
$item_112_product_title = "MGT-112";
$item_113_product_title = "MGT-113";
$message = '';
$interval = 54;
switch(true){
case ($interval > 0) : $message = $message . $item_101_product_title . '<br />';
case ($interval > 21) : $message = $message . $item_102_product_title . '<br />';
case ($interval > 53) : $message = $message . $item_103_product_title . '<br />';
case ($interval > 84) : $message = $message . $item_104_product_title . '<br />';
case ($interval > 115) : $message = $message . $item_105_product_title . '<br />';
case ($interval > 146) : $message = $message . $item_106_product_title . '<br />';
case ($interval > 177) : $message = $message . $item_107_product_title . '<br />';
case ($interval > 208) : $message = $message . $item_108_product_title . '<br />';
case ($interval > 239) : $message = $message . $item_109_product_title . '<br />';
case ($interval > 270) : $message = $message . $item_110_product_title . '<br />';
case ($interval > 302) : $message = $message . $item_111_product_title . '<br />';
case ($interval > 332) : $message = $message . $item_112_product_title . '<br />'; break;
}
echo $message;
?>
I expect the output to be ...
MGT-101
MGT-102
MGT-103
Instead, I get ....
MGT-101
MGT-102
MGT-103
MGT-104
MGT-105
MGT-106
MGT-107
MGT-108
MGT-109
MGT-110
MGT-111
MGT-112
Where did I go wrong?