Re: [PHP] Switch Statement

2013-09-29 Thread mrfroasty
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

Re: [PHP] Switch Statement

2013-09-29 Thread Aziz Saleh
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. >> >

Re: [PHP] Switch Statement

2013-09-28 Thread Ethan Rosenberg
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 Aziz - Used var_dump no further information Ethan -- PHP General Mailing List (http://www.php.net/) To unsubscribe

Re: [PHP] Switch Statement

2013-09-28 Thread Aziz Saleh
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 swit

Re: [PHP] Switch statement Question

2009-01-30 Thread Thodoris
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 possib

Re: [PHP] Switch statement Question

2009-01-29 Thread Jochem Maas
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: >> >> //

RE: [PHP] Switch statement Question

2009-01-29 Thread Boyd, Todd M.
> -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 f

RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Mark Charette
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": > ... > cas

Re: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Leif K-Brooks
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: Do Stuff Note the comma delimited set of values for the case. Is there a way to do this in php?( i.e. if any of

RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Mark Charette
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 ...

RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Martin Towell
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

Re: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread CF High
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 her

Re: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread Noah
OTECTED]> 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

Re: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread Noah
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

Re: [PHP] Switch statement || How to output html without using echo()or print()

2003-01-25 Thread Leif K-Brooks
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: 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; } ?

Re: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread Johannes Schlueter
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 Hello johannes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread John W. Holmes
> 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 y

Re: [PHP] switch statement question

2002-08-13 Thread DL Neil
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: > > Switch($st

RE: [PHP] switch statement question

2002-08-13 Thread Jay Blanchard
[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 "ERR

Re: [PHP] switch-statement overrides use of global arrays?

2001-10-29 Thread Imar de Vries
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.

Re: [PHP] switch-statement overrides use of global arrays?

2001-10-29 Thread Christian Reiniger
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 [...] > swi

Re: [PHP] switch-statement overrides use of global arrays?

2001-10-28 Thread Imar de Vries
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 c

Re: [PHP] switch-statement overrides use of global arrays?

2001-10-28 Thread DL Neil
indeed 'reset' the values)) Regards, =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: > >

Re: [PHP] switch-statement overrides use of global arrays?

2001-10-28 Thread Henrik Hudson
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

Re: [PHP] switch-statement overrides use of global arrays?

2001-10-28 Thread Imar de Vries
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

Re: [PHP] switch-statement overrides use of global arrays?

2001-10-28 Thread Henrik Hudson
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 outs

Re: [PHP] switch statement

2001-02-25 Thread David Robley
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 th

RE: [PHP] switch statement

2001-02-25 Thread Peter Houchin
witch 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 the

Re: [PHP] switch statement

2001-02-25 Thread David Robley
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

Re: [PHP] switch statement

2001-02-25 Thread Jon Rosenberg
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: [