note 87618 added to control-structures.switch

From: Date: Fri, 12 Dec 2008 21:59:56 +0000
Subject: note 87618 added to control-structures.switch
Groups: php.notes 
Request: Send a blank email to php-notes+get-148105@lists.php.net to get a copy of this message
in case of multiple switch is needed this may also work. 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; } ---- Server IP: 193.190.67.6 Probable Submitter: 81.245.41.89 ---- Manual Page -- http://www.php.net/manual/en/control-structures.switch.php Edit -- https://master.php.net/note/edit/87618 Del: integrated -- https://master.php.net/note/delete/87618/integrated Del: useless -- https://master.php.net/note/delete/87618/useless Del: bad code -- https://master.php.net/note/delete/87618/bad+code Del: spam -- https://master.php.net/note/delete/87618/spam Del: non-english -- https://master.php.net/note/delete/87618/non-english Del: in docs -- https://master.php.net/note/delete/87618/in+docs Del: other reasons-- https://master.php.net/note/delete/87618 Reject -- https://master.php.net/note/reject/87618 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#148105) next »