What is the output?
On Sun, Sep 29, 2013 at 1:34 AM, Ethan Rosenberg
erosenb...@hygeiabiomedical.com wrote:
On 09/28/2013 10:53 PM, Aziz Saleh wrote:
Ethan, can you do a var_dump instead of print_r. It might be that
next_step
has spaces in it causing the switch to not match.
Aziz
Hello,
I suggest you put default in that switch statement and var_dump the
$_POST.That should be enough for a programmer to pin point what goes wrong.
P:S
**You might want to consider versioning your codes to go back into its
history to see what has changed.
Muhsin
On 09/29/2013 04:33 AM,
Ethan, can you do a var_dump instead of print_r. It might be that next_step
has spaces in it causing the switch to not match.
Aziz
On Sat, Sep 28, 2013 at 10:33 PM, Ethan Rosenberg
erosenb...@hygeiabiomedical.com wrote:
Dear List -
I have a working program. I made one change in a switch
On 09/28/2013 10:53 PM, Aziz Saleh wrote:
Ethan, can you do a var_dump instead of print_r. It might be that next_step
has spaces in it causing the switch to not match.
Aziz
snip
Aziz -
Used var_dump no further information
Ethan
--
PHP General Mailing List (http://www.php.net/)
To
Hi,
I have a code snippet here as in the following:
//Switch statements between the four options
switch($string) {
case :
$string= NOT book.author='All';
break;
default:
$string= $string . AND NOT book.author='All';
break;
}
This code does work, but I am wondering if it is possible in
-Original Message-
From: Alice Wei [mailto:aj...@alumni.iu.edu]
Sent: Thursday, January 29, 2009 3:02 PM
To: php-general@lists.php.net
Subject: [PHP] Switch statement Question
Hi,
I have a code snippet here as in the following:
//Switch statements between the four options
Boyd, Todd M. schreef:
-Original Message-
From: Alice Wei [mailto:aj...@alumni.iu.edu]
Sent: Thursday, January 29, 2009 3:02 PM
To: php-general@lists.php.net
Subject: [PHP] Switch statement Question
Hi,
I have a code snippet here as in the following:
//Switch statements
I've been using this:
if (in_array($value, array(foo, bar, blah)))
{
// do something
}
but if you want to use a switch/case, I don't know any easier way.
HTH
Martin
-Original Message-
From: CF High [mailto:[EMAIL PROTECTED]
Sent: Monday, March 03, 2003 1:41 PM
To: [EMAIL
Check the manual:
switch($foo)
{
case fee:
case fie:
...
break;
case fo:
...
case fum:
...
break;
}
fee fie are tied together, fie will also run the code presented by fum ...
Even
switch($value){
case 'foo':
case 'bar':
//It's either foo or bar
break;
}
CF High wrote:
Hey all.
In Cold Fusion I was able to do the following:
CFSWITCH expression = #action#
CFCASE value = getUpdate,getDelete
Do Stuff
/CFCASE
/CFSWITCH
Note the comma
Duh. make that
fo will also run the code presented by fum ...
-Original Message-
From: Mark Charette [mailto:[EMAIL PROTECTED]
switch($foo)
{
case fee:
case fie:
...
break;
case fo:
...
case fum:
I've got a simple switch statement that carries out one of several
operations based on the switch statement variable value.
Each operation has @ 50 lines of html -- do I have to echo or print
all
this
html!?
You could put your HTML into a separate file and just include() it
wherever you
On Saturday 25 January 2003 20:38, CF High wrote:
Each operation has @ 50 lines of html -- do I have to echo or print all
this html!?
Try something like
?php
switch ($foo) {
case 1:
?
h1Hello/h1
?php
break;
}
?
johannes
--
PHP General Mailing List (http://www.php.net/)
To
No. You can either echo/print with a heredoc (which is still
echoing/printing, but is a lot easier) or you can exit PHP. For example:
?php
switch($somevar){
case 'case1':
print END
some html
some html
some html
END;
break;
case 'case2':
print END
some html
some html
some html
END;
break;
}
?
PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, January 25, 2003 8:38 AM
Subject: Re: [PHP] Switch statement || How to output html without using
echo() or print()
On Saturday 25 January 2003 20:38, CF High wrote:
Each operation has @ 50 lines of html -- do I have to echo or print all
: John W. Holmes [EMAIL PROTECTED]
To: 'CF High' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, January 25, 2003 8:42 AM
Subject: RE: [PHP] Switch statement || How to output html without using
echo() or print()
I've got a simple switch statement that carries out one of several
operations
Thanks for the informative response, Leif.
Looks like you and Johannes are on the same page -- these solutions save a
great deal of time.
Thanks,
--Noah
Leif K-Brooks [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
No. You can either echo/print with a heredoc
[snip]
Say i have a variable $string_var = Once upon a time;
is there a way to do this:
Switch($string_var)
{
case(contains Once):
doSomething();
break;
case(contains the end.)
doOtherThing();
break;
case(contains time)
doNothing();
break;
default:
echo ERROR
}
Alternatively Alexander,
take a look at the string functions eg strstr(), stristr(), and strpos() all
of which can be used to make a condition within the case() criteria.
Regards,
=dn
[snip]
Say i have a variable $string_var = Once upon a time;
is there a way to do this:
On Sunday 28 October 2001 22:17, Imar de Vries wrote:
Hi all,
a very frustrating problem. For some reason I am not able to pass on an
array between two functions, although I declare it global in both of
them. I suspect my use of a switch statement to control the flow of the
[...]
switch
Christian Reiniger wrote:
So you want to share the array across *requests*
That doesn't have *anything* to do with global.
Have a look at how HTTP works - each request is an isolated execution of
a PHP script. it doesn't have any idea of what other pages the user
already looked at. To
Hey-
I would think you would need to define $array_test outside in a global
environment rather then inside the function since I think/thought it will
just stay scoped in there and that global was used to access variables
which weren't defined inside a functions scope and make it look
Henrik Hudson wrote:
I would think you would need to define $array_test outside in a global
environment rather then inside the function since I think/thought it will
just stay scoped in there and that global was used to access variables
which weren't defined inside a functions scope and
Well, the switch statement will only run ONE of the functions, never both.
The default runs and then you break out of the switch, also: shouldn't
default be at the bottom of the switch? or is that just convention? Anyways,
there is no way for main() to ever pass anything to test_one(), since
,
=dn
- Original Message -
From: Imar de Vries [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 28 October 2001 21:49
Subject: Re: [PHP] switch-statement overrides use of global arrays?
Henrik Hudson wrote:
I would think you would need to define $array_test outside in a global
Dl Neil wrote:
The global array is being defined in the mainline, but not populated. What happens
if you set element 0 to some
value (to take up some storage space first) and then try the switched function calls?
This did not produce the desired result, unfortunately. The array is filled
Here is a basic example.
switch ($option)
{
case "optiona":
statements;
statements;
break;
case "optionb":
statements;
break;
}
- Original Message -
From: "Peter Houchin" [EMAIL PROTECTED]
To: "PHP MAIL GROUP" [EMAIL PROTECTED]
Sent: Sunday, February 25, 2001 9:03 PM
Subject:
On Mon, 26 Feb 2001 12:33, Peter Houchin wrote:
Does any one know where there are some tutorials for the switch
statement?
Peter Houchin
Sun Rentals
[EMAIL PROTECTED]
Have a quick look at
http://www.php.net/manual/en/control-structures.switch.php
which has some user notes which are
between the 2 cases
-Original Message-
From: David Robley [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 1:34 PM
To: Peter Houchin; PHP MAIL GROUP
Subject: Re: [PHP] switch statement
On Mon, 26 Feb 2001 12:33, Peter Houchin wrote:
Does any one know where there are some
On Mon, 26 Feb 2001 13:20, Peter Houchin wrote:
I'm playing aruond with the switch statement trying to get one to work
for $submit
I have 2 forms on the one page (only one displays at a time) 1 is for
creating a new record in my data base the other is for
updating/changing values from the
30 matches
Mail list logo