mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
WS
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@219226 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
3a9d373d06
commit
17a283bd6a
1 changed files with 13 additions and 13 deletions
|
@ -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 @@ function standard_array_compare($op1, $op2)
|
|||
<example>
|
||||
<title>Assigning a default value</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Example usage for: Ternary Operator
|
||||
$action = (empty($_POST['action'])) ? 'default' : $_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'];
|
||||
}
|
||||
// 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>
|
||||
|
|
Loading…
Reference in a new issue