RE: [PHP] Function Switch($pid) - NEED HELP

From: Date: Sat, 25 May 2002 12:58:18 +0000
Subject: RE: [PHP] Function Switch($pid) - NEED HELP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-99229@lists.php.net to get a copy of this message
-----Original Message----- > From: Vincent Kruger [mailto:vins@webonline.co.za] > Sent: Saturday, May 25, 2002 8:41 AM > To: php-general@lists.php.net > Subject: [PHP] Function Switch($pid) - NEED HELP > I have a script that switches. > switch($pid) > { > case 1: > break; > > case 2: > break; > } > Now I'm doing a check in case 1 and if everything goes > well, I want to > switch directly to case 2 while the script is runny. > How would I do that ??? I'm not sure I'm understanding your question properly. But does this do what you want? switch ($pid) { case 1: if (!test you want) then break; // If test is true, execution "falls // through" to next case case 2: ... break; } -- JR

« previous php.general (#99229) next »