Re: [PHP] if then else short form

2005-01-21 Thread Manoj
language tutorial (basic)... >if ( a=b ) ? a=1 ; a=2; a = a==b ? 1 : 2 ; Cheer, Manoj Kr. Sheoran Software Engg. Daffodil Software Ltd. web: www.daffodildb.com INDIA On Fri, 2005-01-21 at 17:31, Ben Edwards wrote: > I seem to remember seing someone use a abreaviated form of a > if/th

Re: [PHP] if then else short form

2005-01-21 Thread Jochem Maas
Ben Edwards wrote: I seem to remember seing someone use a abreaviated form of a if/them/else of the type that can be used in java. It was something like if ( a=b ) ? a=1 ; a=2; I called it the 'tertiary' syntax which is not correct: to quote a page I found: " that the book refers to a "tertiary" op

Re: [PHP] if then else short form

2005-01-21 Thread Jochem Maas
Ben Edwards wrote: I seem to remember seing someone use a abreaviated form of a if/them/else of the type that can be used in java. It was something like if ( a=b ) ? a=1 ; a=2; $a = ($a == $b) ? 1: 2; which meand: if $a is equal to $b then set $a to 1 otherwise set $a to 2. that is equivalent to:

Re: [PHP] if then else short form

2005-01-21 Thread Sergio Gorelyshev
On Fri, 21 Jan 2005 12:01:09 + Ben Edwards <[EMAIL PROTECTED]> wrote: > I seem to remember seing someone use a abreaviated form of a > if/them/else of the type that can be used in java. > > It was something like > > if ( a=b ) ? a=1 ; a=2; > > Anybody know what the correct syntax is? condi

Re: [PHP] if then else short form

2005-01-21 Thread Richard Davey
Hello Ben, Friday, January 21, 2005, 12:01:09 PM, you wrote: BE> I seem to remember seing someone use a abreaviated form of a BE> if/them/else of the type that can be used in java. BE> It was something like BE> if ( a=b ) ? a=1 ; a=2; BE> Anybody know what the correct syntax is? It's called a