Re: [PHP] what do '?' and ':' do?

2004-05-17 Thread John W. Holmes
From: "Radek Zajkowski" <[EMAIL PROTECTED]> > $module_dir = ($module == "") > ? "" > : $module."/"; > > what does the semicolon and the question mark do? Ternary Operator: http://us2.php.net/operators.comparison ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscrib

RE: [PHP] what do '?' and ':' do?

2004-05-17 Thread Chris W. Parker
Radek Zajkowski on Monday, May 17, 2004 12:38 PM said: > $module_dir = ($module == "") > ? "" > : $module."/"; > > what does the semicolon and the question mark do? i think it's called a ternary operator. usually i write it all on one line like so:

Re: [PHP] what do '?' and ':' do?

2004-05-17 Thread Travis Low
They confuse non-C programmers, mostly. See this: http://www.php.net/operators.comparison cheers, Travis Radek Zajkowski wrote: Here's a code snippet // call gui object method $method = $cmd."Object"; $class_name = $objDefinition->getClassName($obj_type); $module = $objDefinition->getModule($obj_ty

Re: [PHP] what do '?' and ':' do?

2004-05-17 Thread Matt Matijevich
[snip] what does the semicolon and the question mark do? [/snip] http://www.php.net/operators.comparison look at the ternary operator -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] what do '?' and ':' do?

2004-05-17 Thread Radek Zajkowski
Here's a code snippet // call gui object method $method = $cmd."Object"; $class_name = $objDefinition->getClassName($obj_type); $module = $objDefinition->getModule($obj_type); $module_dir = ($module == "") ? "" : $module."/"; what does the semicolon and the question mark do? TIA