[PHP] Re: Simple coding question

2004-11-19 Thread Daniel Schierbeck
Octavian Rasnita wrote: Hi all, Please tell me which is the shortest method for writing the following code: $var = $_GET['var'] || 'value'; I want the program to put the value "value" in the variable $var if the array element 'var' is not defined or in case it is 0 and I would like to avoid using t

[PHP] Re: Simple coding question

2004-11-19 Thread M. Sokolewicz
$var = ($_GET['var'] ? $_GET['var'] : 'value'); Octavian Rasnita wrote: Hi all, Please tell me which is the shortest method for writing the following code: $var = $_GET['var'] || 'value'; I want the program to put the value "value" in the variable $var if the array element 'var' is not defined or i