summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdam Bard <github@adambard.com>2013-07-03 08:32:55 -0700
committerAdam Bard <github@adambard.com>2013-07-03 08:32:55 -0700
commit7599a283676dcbd90557239d03ae5266b62549b1 (patch)
tree9fa82741273498e5201ee0f5b1d4d59933b2d34d
parent03ac46f56654ce669596399ff9861d770b890102 (diff)
parentbc6b91a43fcd965a471724a6ee946f0f87d5d5af (diff)
Merge pull request #92 from paolomainardi/master
Ternary operator example
-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:
?>