note 87618 deleted from control-structures.switch by aidan
| From: | aidan@php.net | Date: | Tue, 04 May 2010 04:06:03 +0000 |
| Subject: | note 87618 deleted from control-structures.switch by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-168907@lists.php.net to get a copy of this message | ||
Note Submitter: Dimitri
----
in case of multiple switch is needed this may also work.
<?php
switch (true)
{
case ($full_datum_auto==NULL and $full_datum_rev==NULL):
$datemessage = "both NULL";
break;
case ($full_datum_auto==NULL and $full_datum_rev!=NULL):
$datemessage = "REVISED";
break;
case ($full_datum_auto!=NULL and $full_datum_rev==NULL):
$datemessage = "AUTO";
break;
case ($full_datum_auto!=NULL and $full_datum_rev!=NULL):
if ($full_datum_rev > $full_datum_auto)
{
$datemessage = "AUTO and REVISED, but REVISED is bigger";
}
elseif ($full_datum_rev == $full_datum_auto)
{
$datemessage = "both equal";
}
else
{
$datemessage = "AUTO and REVISED, but AUTO is bigger";
}
break;
default :
$datemessage = "default filter is reached";
break;
}
?>