⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 control-structures.else.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>else</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="control-structures.if.html">if</a></div> <div class="next" style="text-align: right; float: right;"><a href="control-structures.elseif.html">elseif/else if</a></div> <div class="up"><a href="language.control-structures.html">Control Structures</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="control-structures.else" class="sect1">   <h2 class="title"><i>else</i></h2>   <p class="para">    Often you&#039;d want to execute a statement if a certain condition is    met, and a different statement if the condition is not met.  This    is what <i>else</i> is for.  <i>else</i>    extends an <i>if</i> statement to execute a statement    in case the expression in the <i>if</i> statement    evaluates to <b><tt>FALSE</tt></b>.  For example, the following    code would display <span class="computeroutput">a is bigger than    b</span> if <var class="varname">$a</var> is bigger than    <var class="varname">$b</var>, and <span class="computeroutput">a is NOT bigger    than b</span> otherwise:    <div class="informalexample">     <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">$a&nbsp;</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">$b</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"a&nbsp;is&nbsp;bigger&nbsp;than&nbsp;b"</span><span style="color: #007700">;<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"a&nbsp;is&nbsp;NOT&nbsp;bigger&nbsp;than&nbsp;b"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>     </div>    </div>    The <i>else</i> statement is only executed if the    <i>if</i> expression evaluated to    <b><tt>FALSE</tt></b>, and if there were any    <i>elseif</i> expressions - only if they evaluated to    <b><tt>FALSE</tt></b> as well (see <a href="control-structures.elseif.html" class="link">elseif</a>).   </p>  </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="control-structures.if.html">if</a></div> <div class="next" style="text-align: right; float: right;"><a href="control-structures.elseif.html">elseif/else if</a></div> <div class="up"><a href="language.control-structures.html">Control Structures</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -