📄 function.is-array.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Finds whether a variable is an array</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="function.intval.html">intval</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.is-binary.html">is_binary</a></div> <div class="up"><a href="ref.var.html">Variable handling Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.is-array" class="refentry"> <div class="refnamediv"> <h1 class="refname">is_array</h1> <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">is_array</span> — <span class="dc-title">Finds whether a variable is an array</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><b><b>is_array</b></b></span> ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <tt class="parameter">$var</tt></span> )</div> <p class="para rdfs-comment"> Finds whether the given variable is an array. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">var</tt></i></span> <dd> <p class="para"> The variable being evaluated. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <b><tt>TRUE</tt></b> if <i><tt class="parameter">var</tt></i> is an <a href="language.types.array.html" class="type array">array</a>, <b><tt>FALSE</tt></b> otherwise. </p> </div> <div class="refsect1 examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example"> <p><b>Example #1 Check that variable is an array</b></p> <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?php<br />$yes </span><span style="color: #007700">= array(</span><span style="color: #DD0000">'this'</span><span style="color: #007700">, </span><span style="color: #DD0000">'is'</span><span style="color: #007700">, </span><span style="color: #DD0000">'an array'</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$yes</span><span style="color: #007700">) ? </span><span style="color: #DD0000">'Array' </span><span style="color: #007700">: </span><span style="color: #DD0000">'not an Array'</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$no </span><span style="color: #007700">= </span><span style="color: #DD0000">'this is a string'</span><span style="color: #007700">;<br /><br />echo </span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$no</span><span style="color: #007700">) ? </span><span style="color: #DD0000">'Array' </span><span style="color: #007700">: </span><span style="color: #DD0000">'not an Array'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?></span></span></code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents"><pre><div class="cdata"><pre>Arraynot an Array</pre></div> </pre></div> </div> </p> </div> <div class="refsect1 seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><a href="function.is-float.html" class="function" rel="rdfs-seeAlso">is_float()</a></li> <li class="member"><a href="function.is-int.html" class="function" rel="rdfs-seeAlso">is_int()</a></li> <li class="member"><a href="function.is-string.html" class="function" rel="rdfs-seeAlso">is_string()</a></li> <li class="member"><a href="function.is-object.html" class="function" rel="rdfs-seeAlso">is_object()</a></li> </ul> </p> </div> </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.intval.html">intval</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.is-binary.html">is_binary</a></div> <div class="up"><a href="ref.var.html">Variable handling Functions</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 + -