summaryrefslogtreecommitdiffhomepage
path: root/php.html.markdown
diff options
context:
space:
mode:
authorPaolo Mainardi <paolo@twinbit.it>2013-07-03 13:31:09 +0200
committerPaolo Mainardi <paolo@twinbit.it>2013-07-03 13:31:09 +0200
commitbc6b91a43fcd965a471724a6ee946f0f87d5d5af (patch)
tree9fa82741273498e5201ee0f5b1d4d59933b2d34d /php.html.markdown
parent03ac46f56654ce669596399ff9861d770b890102 (diff)
Ternary operator example
Diffstat (limited to 'php.html.markdown')
-rw-r--r--php.html.markdown5
1 files changed, 5 insertions, 0 deletions
diff --git a/php.html.markdown b/php.html.markdown
index 75bbd214..f0c5c918 100644
--- a/php.html.markdown
+++ b/php.html.markdown
@@ -231,6 +231,9 @@ if (false) {
print 'Does';
}
+// ternary operator
+print (false ? 'Does not get printed' : 'Does');
+
$x = 0;
if ($x === '0') {
print 'Does not print';
@@ -240,6 +243,8 @@ if ($x === '0') {
print 'Does print';
}
+
+
// This alternative syntax is useful for templates:
?>