admin 发表于 2023-2-16 18:54:59

PHP中的array_intersect_assoc()函数

<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">
                  <h2>定义和用法</h2>
<p>array_intersect_assoc() 函数用于比较两个&#xff08;或更多个&#xff09;数组的<strong>键名和键值</strong>&#xff0c;并返回交集。</p>
<p>该函数比较两个&#xff08;或更多个&#xff09;数组的键名和键值&#xff0c;并返回一个交集数组&#xff0c;该数组包括了所有在被比较的数组&#xff08;<em>array1</em>&#xff09;中&#xff0c;同时也在任何其他参数数组&#xff08;<em>array2</em> 或 <em>array3</em> 等等&#xff09;中的键名和键值。</p>
<hr>
<h2>语法</h2>
<p>array_intersect_assoc(<em>array1,array2,array3...</em>)</p>
<p></p>
<table><tbody><tr><th>参数</th><th>描述</th></tr><tr><td style="vertical-align:top;"><em>array1</em></td><td style="vertical-align:top;">必需。与其他数组进行比较的第一个数组。</td></tr><tr><td style="vertical-align:top;"><em>array2</em></td><td style="vertical-align:top;">必需。与第一个数组进行比较的数组。</td></tr><tr><td style="vertical-align:top;"><em>array3,...</em></td><td style="vertical-align:top;">可选。与第一个数组进行比较的其他数组。</td></tr></tbody></table>
<p></p>
<p>返回对比2个数组的交集&#xff0c;使用array_intersect_assoc()函数</p>
<p></p>
<p></p>
                </div>
      </div>
      <div id="treeSkill"></div>
页: [1]
查看完整版本: PHP中的array_intersect_assoc()函数