PHP中的array_flip()函数
<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">
<blockquote>
<p><?php<br> $a1=array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow");<br> $result=array_flip($a1);<br> print_r($result);<br> ?></p>
</blockquote>
<p></p>
<p> </p>
<h2>定义和用法</h2>
<p>array_flip() 函数用于反转/交换数组中的键名和对应关联的键值。</p>
<hr>
<h2>语法</h2>
<p>array_flip(<em>array</em>);</p>
<p></p>
<table><tbody><tr><th>参数</th><th>描述</th></tr><tr><td><em>array</em></td><td>必需。规定需进行键/值对反转的数组。</td></tr></tbody></table>
<h2>技术细节</h2>
<table><tbody><tr><th>返回值:</th><td>如果反转成功,则返回反转后的数组。如果反转失败,则返回 NULL。</td></tr><tr><th>PHP 版本:</th><td>4+</td></tr></tbody></table>
</div>
</div>
<div id="treeSkill"></div>
页:
[1]