: www.BarloworldOptimus.com
-Original Message-
From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]]
Sent: 21 November 2002 02:59 PM
To: David Russell
Cc: 'Martin Hudec'; 'PHP'
Subject: RE: [PHP] character ' in switch
At 13:16 21.11.2002, David Russell spoke out and said:
At 13:16 21.11.2002, David Russell spoke out and said:
[snip]
>Hi Martin,
>
>Just a thought - can't you escape it?
>
>switch ($_GET['action']) {
> case "about":
> code
> break;
>
> case "what\'s new": <-- i want this...
> code
>
Hi Martin,
Just a thought - can't you escape it?
switch ($_GET['action']) {
case "about":
code
break;
case "what\'s new": <-- i want this...
code
break;
default:
break;
}
You would definitely need to put it into quotes (as I have above)
Hi Martin,
> I would like to know how can I put ' character to case in switch...
>
> switch ($action) {
>case about:
>code
>break;
>
>case what's new: <-- i want this...
>code
>break;
Try wrapping the cases in quotes:
switch ($action) {
case "
4 matches
Mail list logo