PHP中使用compact函数
<div id="article_content" class="article_content clearfix"><link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/kdoc_html_views-1a98987dfd.css">
<link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/ck_htmledit_views-6e43165c0a.css">
<div id="content_views" class="htmledit_views">
<p>在PHP中使用compact函数将compact里面的值,提取出来作为key,赋值给对应的变量。</p>
<h2>定义和用法</h2>
<p>compact() 函数创建一个包含变量名和它们的值的数组。</p>
<p><strong>注释:</strong>任何没有变量名与之对应的字符串都被略过。</p>
<hr>
<h2>语法</h2>
<p>compact(<em>var1,var2...</em>)</p>
<p></p>
<table><tbody><tr><th>参数</th><th>描述</th></tr><tr><td style="vertical-align:top;"><em>var1</em></td><td style="vertical-align:top;">必需。可以是带有变量名的字符串,或者是一个变量数组。</td></tr><tr><td style="vertical-align:top;"><em>var2,...</em></td><td style="vertical-align:top;">可选。可以是带有变量名的字符串,或者是一个变量数组。允许多个参数。</td></tr></tbody></table>
<h2>Technical Details</h2>
<table><tbody><tr><th>返回值:</th><td>返回带有所有变量名和它们的值的数组。</td></tr><tr><th>PHP 版本:</th><td>4+</td></tr></tbody></table>
<p></p>
<p></p>
<p> </p>
<p></p>
<p> </p>
<p></p>
<p></p>
</div>
</div>
<div id="treeSkill"></div>
页:
[1]