PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
...can't quite figure that out. Am I just retarded or that another way to do an if statement with no else clause? i.e.
those are if statements with a single line of code to execute. Braces are only required for running multiple lines under the control of an if. The following is also perfectly valid:
<?php
if(!defined('_DEBUG_')) {
define('_DEBUG_',0);
}
if(1 || _DEBUG_) { // that whole (1 || _DEBUG_) thing confuses me too
echo $text;
}
?>
All I was doing here was forcing the echo to happen regardless of the status of _DEBUG_ (a constant, in this case) .. this was used to illustrate the before component of the code transformation I was writing about.