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

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                `~~~ /** * 向文件頭部加入內容 * @param string $fileName * @param $append */ private function writeFileAtFirstLine($fileName='',$append){ @set_time_limit(0); $file = fopen($fileName, 'r'); $content = fread($file, @filesize($fileName)); $contents = $append . PHP_EOL . $content; fclose($file); $file = fopen($fileName, 'w'); $res = fwrite($file, $contents); fclose($file); if ($res >0){ return true; }else{ return false; } } ~~~` `~~~ /** * 向文件尾部加入內容 * @param string $fileName * @param $append * @return bool */ private function writeFileAtLasttLine($fileName='',$append){ @set_time_limit(0); $res = file_put_contents($fileName, $append, FILE_APPEND); if ($res>0){ return true; }else{ return false; } } ~~~` `~~~ /** * 取文件最后$n行 * @param string $filename 文件路徑 * @param int $n 最后幾行 * @return mixed false表示有錯誤,成功則返回字符串 */ private function FileLastLines($filename,$n){ if(!$fp=fopen($filename,'r')){ echo "打開文件失敗,請檢查文件路徑是否正確,路徑和文件名不要包含中文"; return false; } $pos=-2; $eof=""; $str=""; while($n>0){ while($eof!="\n"){ if(!fseek($fp,$pos,SEEK_END)){ $eof=fgets($fp); $pos--; }else{ break; } } $str.=fgets($fp); $eof=""; $n--; } return $str; } ~~~` `~~~ /** * 獲取指定行內容 * * @param $filePath文件路徑 * @param $line 行數 * @param $length 指定行返回內容長度 */ private function getLineContent($filePath, $lineNum, $length = 5000){ $result = null; // 初始化返回 $i = 1; // 行數 $handle = @fopen($filePath, "r"); if ($handle) { while (!feof($handle)) { $buffer = fgets($handle, $length); if($lineNum== $i) $result = $buffer; $i++; } fclose($handle); } return $result ; } ~~~` `~~~ /** * 刪除文件的前幾行 并返回刪除后的數據 * @param $path * @param $line * @return string */ public function removeFileLines($path,$line){ $data = ""; $str = ""; chmod($path, 0777); $handle = fopen($path, 'rw'); for ($i=0; $i<$line;$i++) fgets($handle); ob_start(); while(!feof($handle)){ $str=fgets($handle, 1024); $data = $data.$str; } fclose($handle); file_put_contents($path, $data); ob_end_clean(); return $data; } ~~~` `~~~ /** * 生成新文件并寫入加密內容 * @param $TxtFileName * @param $StrConents * @return bool */ private function WriteFile($TxtFileName,$StrConents){ @set_time_limit(0); $myfile = fopen($TxtFileName, "w") or die("Unable to open file!"); fwrite($myfile, $StrConents); fclose($myfile); return true; } ~~~`
                  <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>

                              哎呀哎呀视频在线观看