nitesh Posted November 18, 2011 Share Posted November 18, 2011 Hi everoneI want to know what is the meaning for using1) ? question mark2) : colon in this input type<INPUT NAME="hidMode" VALUE="<?php echo ($_POST['hidMode'] and $_POST['hidMode'] =="U") ? "U" : "I" ?>" /> Thanks in advanced Link to comment Share on other sites More sharing options...
Don E Posted November 18, 2011 Share Posted November 18, 2011 That's part of PHP's ternary if statement. It's a short way of writing an if statement. If the POST above is equal to "U", the attribute 'value' will be set to "U"...... else(if not), it will be set to: "I". The expression to be evaluated comes before the ? sign. Between the ? and : is what the VALUE will be set to if the expression is true. After the : is what the VALUE attribute will be set to if the expression is false. See here for more info: http://davidwalsh.name/php-shorthand-if-else-ternary-operators Link to comment Share on other sites More sharing options...
nitesh Posted November 18, 2011 Author Share Posted November 18, 2011 Problem solvedThank you very much i got it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.