note 90618 added to control-structures.switch
| From: | mevlutsafi at hotmail dot com | Date: | Thu, 30 Apr 2009 16:42:21 +0000 |
| Subject: | note 90618 added to control-structures.switch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-154054@lists.php.net to get a copy of this message | ||
Its weird but when I dont add break; after switch{} statement, page keeps reloading (twice in my
case).
This example keeps reloading the page and switch statement again:
$op="sponsor";
switch($op) {
case "sponsor":
echo"sponsor";
break;
default:
include("index.php");
break;
}
this double echos sponsor!
if I add a break after the switch then it really breaks!
$op="sponsor";
switch($op) {
case "sponsor":
echo"sponsor";
break;
default:
include("index.php");
break;
}
break;
This would be helpfull if you navigate your site by switch funtion and you need to include a case
into a div via ajax.
----
Server IP: 69.147.83.197
Probable Submitter: 88.250.82.215
----
Manual Page -- http://www.php.net/manual/en/control-structures.switch.php
Edit -- https://master.php.net/note/edit/90618
Del: integrated -- https://master.php.net/note/delete/90618/integrated
Del: useless -- https://master.php.net/note/delete/90618/useless
Del: bad code -- https://master.php.net/note/delete/90618/bad+code
Del: spam -- https://master.php.net/note/delete/90618/spam
Del: non-english -- https://master.php.net/note/delete/90618/non-english
Del: in docs -- https://master.php.net/note/delete/90618/in+docs
Del: other reasons-- https://master.php.net/note/delete/90618
Reject -- https://master.php.net/note/reject/90618
Search -- https://master.php.net/manage/user-notes.php