/ Published in: PHP
put case value1:case value2:case value3: to allow the same code be executed when the value passed equals value1 or value2 or value3.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
switch (value) { case 1: echo "Value was 1"; break; case 2: case 3: echo "Value was 2 or 3"; break; case 4: echo "Value was 4"; break; default: echo "Value was not 1-4"; break; }
URL: http://www.nutt.net/2004/12/28/multiple-cases-for-switch-construct/