tallberg Posted October 8, 2007 Share Posted October 8, 2007 hi I have some experience with php but i have not idea what the ? and the : means in the following code. Please can some one explain. $default_config[$config_name] = isset($HTTP_POST_VARS['submit']) ? str_replace("'", "\'", $config_value) : $config_value; $new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name]; Quote Link to comment https://forums.phpfreaks.com/topic/72344-solved-what-do-they-mean/ Share on other sites More sharing options...
The Little Guy Posted October 8, 2007 Share Posted October 8, 2007 it is short hand for if else statements Quote Link to comment https://forums.phpfreaks.com/topic/72344-solved-what-do-they-mean/#findComment-364812 Share on other sites More sharing options...
MmmVomit Posted October 8, 2007 Share Posted October 8, 2007 You can think of them like an if statement. ($expr ? $true_value : $false_value) $expr is some expression that will be evaluated as either true or false. If it is true, the whole expression in parentheses will evaluate to $true_value. If $expr is false, the whole expression in parentheses will evaluate to $false_value. Quote Link to comment https://forums.phpfreaks.com/topic/72344-solved-what-do-they-mean/#findComment-364813 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.