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

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # PHP fgets() 函數 ## 定義和用法 fgets() 函數從文件指針中讀取一行。 ### 語法 ``` fgets(file,length) ``` | 參數 | 描述 | | --- | --- | | file | 必需。規定要讀取的文件。 | | length | 可選。規定要讀取的字節數。默認是 1024 字節。 | ### 說明 從 _file_ 指向的文件中讀取一行并返回長度最多為 _length_ - 1 字節的字符串。碰到換行符(包括在返回值中)、EOF 或者已經讀取了 _length_ - 1 字節后停止(要看先碰到那一種情況)。如果沒有指定 _length_,則默認為 1K,或者說 1024 字節。 若失敗,則返回 false。 ## 提示和注釋 注釋:_length_ 參數從 PHP 4.2.0 起成為可選項,如果忽略,則行的長度被假定為 1024 字節。從 PHP 4.3 開始,忽略掉 _length_ 將繼續從流中讀取數據直到行結束。如果文件中的大多數行都大于 8 KB,則在腳本中指定最大行的長度在利用資源上更為有效。 注釋:從 PHP 4.3 開始本函數可以安全用于二進制文件。早期的版本則不行。 注釋:如果碰到 PHP 在讀取文件時不能識別 Macintosh 文件的行結束符,可以激活 auto_detect_line_endings 運行時配置選項。 ## 例子 ### 例子 1 ``` <?php $file = fopen("test.txt","r"); echo fgets($file); fclose($file); ?> ``` 輸出類似: ``` Hello, this is a test file. ``` ### 例子 2 ``` <?php $file = fopen("test.txt","r"); while(! feof($file)) { echo fgets($file). "<br />"; } fclose($file); ?> ``` 輸出類似: ``` Hello, this is a test file. There are three lines here. This is the last line. ```
                  <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>

                              哎呀哎呀视频在线观看