<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## 組 > 將包含基本類型的PHP數組包裝到數學集的類。 ### 創建 要創建Set,請僅使用包含基元的平面數組: ``` use \Phpml\Math\Set; $set = new Set([1, 2, 2, 3, 1.1, -1, -10]); $set->toArray(); // return [-10, -1, 1, 1.1, 2, 3] $set = new Set(['B', '', 'A']); $set->toArray(); // return ['', 'A', 'B'] ``` 注入的數組按`SORT_ASC`排序,刪除重復項并重寫索引 ***** ### 并集 創建兩個集合的并集: ``` use \Phpml\Math\Set; $union = Set::union(new Set([1, 3]), new Set([1, 2])); $union->toArray(); //return [1, 2, 3] ``` ***** ### 交集 創建兩個集合的交集: ``` use \Phpml\Math\Set; $intersection = Set::intersection(new Set(['A', 'C']), new Set(['B', 'C'])); $intersection->toArray(); //return ['C'] ``` ***** ### 補充 創建兩個集的集合論差異: ``` use \Phpml\Math\Set; $difference = Set::difference(new Set(['A', 'B', 'C']), new Set(['A'])); $union->toArray(); //return ['B', 'C'] ``` ***** ### 添加元素 ``` use \Phpml\Math\Set; $set = new Set([1, 2]); $set->addAll([3]); $set->add(4); $set->toArray(); //return [1, 2, 3, 4] ``` ***** ### 刪除元素 ``` use \Phpml\Math\Set; $set = new Set([1, 2]); $set->removeAll([2]); $set->remove(1); $set->toArray(); //return [] ``` ***** ### 檢查成員 ``` use \Phpml\Math\Set; $set = new Set([1, 2]); $set->containsAll([2, 3]); //return false $set->contains(1); //return true ``` ***** ### 基數 ``` use \Phpml\Math\Set; $set = new Set([1, 2]); $set->cardinality(); //return 2 ``` ***** ### 是否為空 ``` use \Phpml\Math\Set; $set = new Set(); $set->isEmpty(); //return true ``` ***** ### 使用循環 ``` use \Phpml\Math\Set; $set = new Set(['A', 'B', 'C']); foreach($set as $element) { echo "$element, "; } // echoes A, B, C ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看