note 108080 deleted from control-structures.switch by crell
| From: | crell@php.net | Date: | Mon, 27 Jun 2022 20:38:20 +0000 |
| Subject: | note 108080 deleted from control-structures.switch by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218636@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
Switch usage for make some actions with all of cases
<?php
$out = ' ';
for ($i=1;$i<10:$i++) {
switch ($i) {
case true: $out .= 'test_';
case 1:
case 2:
case 3: $out .= $i;
default: $out .= ' ';
}
}
echo $out;
?>
That sample out:
" test_1 test_2 test_3 "