<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                SplFixedArray主要是處理數組相關的主要功能,與普通php array不同的是,**它是固定長度的,且以數字為鍵名的數組**,優勢就是比普通的數組處理更快。 ## 類摘要 ```php SplFixedArray implements Iterator , ArrayAccess , Countable { /* 方法 */ public __construct ([ int $size = 0 ] ) public int count ( void ) public mixed current ( void ) //↓↓導入PHP數組,返回SplFixedArray對象; public static SplFixedArray fromArray ( array $array [, bool $save_indexes = true ] ) //↓↓把SplFixedArray對象數組導出為真正的數組; public array toArray ( void ) public int getSize ( void ) public int key ( void ) public void next ( void ) public bool offsetExists ( int $index ) public mixed offsetGet ( int $index ) public void offsetSet ( int $index , mixed $newval ) public void offsetUnset ( int $index ) public void rewind ( void ) public int setSize ( int $size ) public bool valid ( void ) public void __wakeup ( void ) } ``` ## Example ```php # Example1: $arr = new SplFixedArray(4); try{ $arr[0] = 'php'; $arr[1] = 'Java'; $arr[3] = 'javascript'; $arr[5] = 'mysql'; }catch(RuntimeException $e){ //由于是定長數組,所以$arr超過定長4;就會拋出異常。 echo $e->getMessage(),' : ',$e->getCode(); } #Example2: // public static SplFixedArray fromArray ( array $array [, bool $save_indexes = true ] ) $arr = [ '4' => 'php', '5' => 'javascript', '0' => 'node.js', '2' => 'linux' ]; //第二參數默認為true的話,保持原索引,如果為false的話,就重組索引; //如下,如果重組了索引,那數組長度就為4;如果不重組長度就為6; $arrObj = SplFixedArray::fromArray($arr); $arrObj->rewind(); while($arrObj->valid()){ echo $arrObj->key(),'=>',$arrObj->current(); echo PHP_EOL; $arrObj->next(); } //↓↓由定長數組對象轉換為真正的數組 $arr = $arrObj->toArray(); print_r($arr); ```
                  <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>

                              哎呀哎呀视频在线观看