sean Fri Sep 1 15:37:21 2006 UTC
Modified files:
/phpdoc/en/language operators.xml
Log:
WS
http://cvs.php.net/viewvc.cgi/phpdoc/en/language/operators.xml?r1=1.103&r2=1.104&diff_format=u
Index: phpdoc/en/language/operators.xml
diff -u phpdoc/en/language/operators.xml:1.103
phpdoc/en/language/operators.xml:1.104
--- phpdoc/en/language/operators.xml:1.103 Fri Sep 1 15:33:53 2006
+++ phpdoc/en/language/operators.xml Fri Sep 1 15:37:21 2006
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.103 $ -->
+<!-- $Revision: 1.104 $ -->
<chapter id="language.operators">
<title>Operators</title>
<simpara>
@@ -654,20 +654,20 @@
<example>
<title>Assigning a default value</title>
<programlisting role="php">
- <![CDATA[
- <?php
- // Example usage for: Ternary Operator
- $action = (empty($_POST['action'])) ? 'default' : $_POST['action'];
-
- // The above is identical to this if/else statement
- if (empty($_POST['action'])) {
- $action = 'default';
- } else {
- $action = $_POST['action'];
- }
+<![CDATA[
+<?php
+// Example usage for: Ternary Operator
+$action = (empty($_POST['action'])) ? 'default' : $_POST['action'];
+
+// The above is identical to this if/else statement
+if (empty($_POST['action'])) {
+ $action = 'default';
+} else {
+ $action = $_POST['action'];
+}
- ?>
- ]]>
+?>
+]]>
</programlisting>
</example>
The expression <literal>(expr1) ? (expr2) : (expr3)</literal>