On 9/29/2013 1:38 AM, Jim Giner wrote:
session_start();
session_name("STORE");
set_time_limit(2400);
ini_set('display_errors', 'on');
ini_set('display_startup_errors', 'on');
error_reporting(-2);
ini_set('error_reporting', 'E_ALL | E_STRICT');
ini_set('html_
On 9/29/2013 1:29 AM, Ethan Rosenberg wrote:
On 09/28/2013 11:59 PM, Jim Giner wrote:
Ethan,Ethan,Ethan - what is all this "stuff" you have at the top??? Do
you know how any of this is supposed to be written? You can not put
Constants in quotes - they become just plain strings then, not Cons
On 09/28/2013 11:59 PM, Jim Giner wrote:
Ethan,Ethan,Ethan - what is all this "stuff" you have at the top??? Do
you know how any of this is supposed to be written? You can not put
Constants in quotes - they become just plain strings then, not Constants
with the predefined values you (and the
Ethan,Ethan,Ethan - what is all this "stuff" you have at the top??? Do
you know how any of this is supposed to be written? You can not put
Constants in quotes - they become just plain strings then, not Constants
with the predefined values you (and the functions) are expecting. For
example
On 9/28/2013 10:33 PM, Ethan Rosenberg wrote:
Dear List -
I have a working program. I made one change in a switch statement, and
it does not work. I'm probably missing something fundamental.
Here are some code SNIPPETS... [please note that all my debug
statements are at the left margin]
Set
On Sat, Nov 17, 2012 at 4:13 PM, Sebastian Krebs wrote:
> 2012/11/17 Andrew Ballard
>
>> On Nov 16, 2012 10:24 PM, "tamouse mailing lists"
>> wrote:
>> >
>> > On Fri, Nov 16, 2012 at 12:41 PM, Sebastian Krebs
>> wrote:
>> > > Beside this it can be rewritten as
>> > >
>> > > switch ((int) (($cou
2012/11/19 Tim Streater
> On 18 Nov 2012 at 14:44, Jim Giner wrote:
>
> > 2. Using Switch {ALWAYS FIRST CASE!!!}
> >
> > //$boxes = 1;
> > //switch ($count) {
> > //case ($count > 14):
> > //$boxes = 3;
> > //
On 19 Nov 2012, at 19:35, Tim Streater wrote:
> On 18 Nov 2012 at 14:44, Jim Giner wrote:
>
>> 2. Using Switch {ALWAYS FIRST CASE!!!}
>>
>> //$boxes = 1;
>> //switch ($count) {
>> //case ($count > 14):
>> //$boxes = 3;
>>
On 18 Nov 2012 at 14:44, Jim Giner wrote:
> 2. Using Switch {ALWAYS FIRST CASE!!!}
>
> //$boxes = 1;
> //switch ($count) {
> //case ($count > 14):
> //$boxes = 3;
> //break;
> //case ($count >
On 11/16/2012 8:33 PM, Iñigo Medina wrote:
On Fri, 16 Nov 2012, Jim Giner wrote:
On 11/16/2012 12:38 PM, Tim Streater wrote:
On 16 Nov 2012 at 12:10, Omar Muhsin wrote:
Hello,
I was just wondering after writting the code in version 2 here
below, it turns
out in testing that it actually PH
On Sat, Nov 17, 2012 at 2:59 PM, Sebastian Krebs wrote:
> (Beside: Was "the principle of least surprise" not a ruby-thing? ;))
No, but the Ruby (and Rails) world takes concepts like this and really
runs with them.
Principle of Least Astonishment has been around for quite some time,
with examples
On Sat, Nov 17, 2012 at 3:13 PM, Sebastian Krebs wrote:
> 2012/11/17 Andrew Ballard
>
>> On Nov 16, 2012 10:24 PM, "tamouse mailing lists"
>> wrote:
>> > Just a tad obscure for someone coming along
>> > later
>>
>> Without knowing the intent of the code, it could be a headache to maintain.
>>
>
2012/11/17 Andrew Ballard
> On Nov 16, 2012 10:24 PM, "tamouse mailing lists"
> wrote:
> >
> > On Fri, Nov 16, 2012 at 12:41 PM, Sebastian Krebs
> wrote:
> > > Beside this it can be rewritten as
> > >
> > > switch ((int) (($count-1) / 7) {
> > > case 0: // 1-7
> > > case 1: // 8 - 14
> > >
2012/11/17 Tim Streater
> On 17 Nov 2012 at 01:33, Iñigo Medina wrote:
>
> > On Fri, 16 Nov 2012, Jim Giner wrote:
>
> >> Maybe I'm way out of touch, but when I look at php.net for the syntax
> of the
> >> switch statement I see:
> >> switch($var){
> >> case (value):
> >> (do s
On Nov 16, 2012 10:24 PM, "tamouse mailing lists"
wrote:
>
> On Fri, Nov 16, 2012 at 12:41 PM, Sebastian Krebs
wrote:
> > Beside this it can be rewritten as
> >
> > switch ((int) (($count-1) / 7) {
> > case 0: // 1-7
> > case 1: // 8 - 14
> > default: // above 15
> > }
>
> Nice code refacto
On 17 Nov 2012, at 10:53, Tim Streater wrote:
> On 17 Nov 2012 at 01:33, Iñigo Medina wrote:
>
>> On Fri, 16 Nov 2012, Jim Giner wrote:
>
>>> Maybe I'm way out of touch, but when I look at php.net for the syntax of the
>>> switch statement I see:
>>> switch($var){
>>> case (value):
>>>
On 17 Nov 2012 at 01:33, Iñigo Medina wrote:
> On Fri, 16 Nov 2012, Jim Giner wrote:
>> Maybe I'm way out of touch, but when I look at php.net for the syntax of the
>> switch statement I see:
>> switch($var){
>> case (value):
>> (do something)
>> case (other value):
>>
On Fri, Nov 16, 2012 at 12:41 PM, Sebastian Krebs wrote:
> Beside this it can be rewritten as
>
> switch ((int) (($count-1) / 7) {
> case 0: // 1-7
> case 1: // 8 - 14
> default: // above 15
> }
Nice code refactoring :) Just a tad obscure for someone coming along
later, perhaps.
--
PHP Ge
On Fri, 16 Nov 2012, Jim Giner wrote:
On 11/16/2012 12:38 PM, Tim Streater wrote:
On 16 Nov 2012 at 12:10, Omar Muhsin wrote:
Hello,
I was just wondering after writting the code in version 2 here below, it
turns
out in testing that it actually PHP is not validating the expressions
instea
On 11/16/2012 12:38 PM, Tim Streater wrote:
On 16 Nov 2012 at 12:10, Omar Muhsin wrote:
Hello,
I was just wondering after writting the code in version 2 here below, it turns
out in testing that it actually PHP is not validating the expressions instead
always I get the first case.
1.Using nes
2012/11/16 Tim Streater
> On 16 Nov 2012 at 12:10, Omar Muhsin wrote:
>
> > Hello,
> >
> > I was just wondering after writting the code in version 2 here below, it
> turns
> > out in testing that it actually PHP is not validating the expressions
> instead
> > always I get the first case.
> >
> >
On 16 Nov 2012 at 12:10, Omar Muhsin wrote:
> Hello,
>
> I was just wondering after writting the code in version 2 here below, it turns
> out in testing that it actually PHP is not validating the expressions instead
> always I get the first case.
>
> 1.Using nested if statement {THE INTENDED BEH
"tedd" wrote in message
news:p06240801c5aa0ed7d...@[192.168.1.101]...
> At 4:16 PM +0100 1/30/09, Jochem Maas wrote:
>>tedd schreef:
>>> At 4:43 PM -0500 1/29/09, Frank Stanovcak wrote:
>"
yes...that is legal. as long as the statment resolves to a boolean it
will
At 4:16 PM +0100 1/30/09, Jochem Maas wrote:
tedd schreef:
At 4:43 PM -0500 1/29/09, Frank Stanovcak wrote:
>"
yes...that is legal. as long as the statment resolves to a boolean it
will
work. It's not technically correct, but it does work.
There you go again. What's technically corr
tedd schreef:
> At 4:43 PM -0500 1/29/09, Frank Stanovcak wrote:
>> >"
>>
>> yes...that is legal. as long as the statment resolves to a boolean it
>> will
>> work. It's not technically correct, but it does work.
>
> There you go again. What's technically correct?
hiya tedd,
you mean to ask "n
At 4:43 PM -0500 1/29/09, Frank Stanovcak wrote:
>"
yes...that is legal. as long as the statment resolves to a boolean it will
work. It's not technically correct, but it does work.
There you go again. What's technically correct?
Cheers,
tedd
--
---
http://sperling.com http://ancient
>"Alice Wei" wrote in message
>news:snt101-w587cd616331fc59b84834af0...@phx.gbl...
>
>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 . "AN
Diogo Neves a écrit :
Hi,
Well, I see a good reason anyway...
U can have a lot of entry points and only one to exit...
Like:
I misunderstood the question :-/ I read Govinda had a strange
behavior that ignore the break :-D
--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org
--
PHP Ge
Hi,
Well, I see a good reason anyway...
U can have a lot of entry points and only one to exit...
Like:
switch ($i) {
case 0:
echo "\$i < 1";
case 1:
echo "\$i < 2";
case 2:
echo "\$i < 3";
default:
echo "\$i > 2";
}
Or
switch ($i) {
case 0:
case 1:
case 2:
echo "\$i < 3";
brea
Govinda a écrit :
Or is there a better reason?
What is exactly in $i ? A scalar integer, a string containing an
integer ? A boolean ? What version of PHP ?
--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: htt
Cant be done mate, do it like this...
switch ($val){
case "FFS":
case "FHG":
case "FRG":
//stuff
break;
case "DPT":
case "DL":
case "DF":
case "DI":
case "DO":
//stuff
break;
}
The cases pass through each other till they hit a 'break'
;o)
Bix
"Stephen Goddard" <[EMAIL PROTECTED]>
> 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 ???
>
Don't write "break;" in
32 matches
Mail list logo