當前位置:首頁 » 編程語言 » phpstart

phpstart

發布時間: 2024-09-19 00:15:48

A. php中ob_start是什麼功能

ob是output buffering的簡稱,就是輸出緩沖區。如果使用了ob_start函數,那麼之後的輸出內容(echo等)就不進行實際輸出,而是存入緩沖區裡面,隨後可以使用ob_flush實際輸出、ob_clean刪除、ob_get_contents獲得內容保存到靜態文件等。

使用輸出緩沖區有兩個主要的好處:一是可以在輸出一些內容之後在設置header(例如cookie等),使得程序設計的邏輯性變得簡單;二是可以對緩沖區裡面的輸出內容撤銷、刪除、壓縮、保存到文件等操作。

相關的操作是使用一系列的ob_函數來實現的,常用的有下面這些,通過函數名稱可以猜測其功能,需要獲得詳細幫助可以查看文檔或者網路搜索:
ob_clean — Clean (erase) the output buffer
ob_end_clean — Clean (erase) the output buffer and turn off output buffering
ob_end_flush — Flush (send) the output buffer and turn off output buffering
ob_flush — Flush (send) the output buffer
ob_get_clean — Get current buffer contents and delete current output buffer
ob_get_contents — Return the contents of the output buffer
ob_get_flush — Flush the output buffer, return it as a string and turn off output buffering
ob_get_length — Return the length of the output buffer
ob_get_level — Return the nesting level of the output buffering mechanism
ob_get_status — Get status of output buffers
ob_gzhandler — ob_start callback function to gzip output buffer
ob_implicit_flush — Turn implicit flush on/off
ob_list_handlers — List all output handlers in use
ob_start — Turn on output buffering
output_add_rewrite_var — Add URL rewriter values
output_reset_rewrite_vars — Reset URL rewriter values

B. PHP Warning: PHP Startup: in Unknown on line 0,這是錯在哪了求高手解答

這個是php配置問題,你配置的時候加了 php_zip.dll 擴展,但是你的擴展路徑設錯了,你設的是相對 路徑,在WINDOW 中,這種路徑 不好用,如果你的php 是安裝 在 d:/server/php中,那個你的這個 擴展路徑應該設為 extension_dir = "D:/server/php/ext" 這樣,絕對 路徑才行。 這個是在php.ini 裡面設置的。同時 注意,我的是/ ,這樣在 window ,linux 都是正確訪問 的。

熱點內容
安卓開發選哪個版本的SDK 發布:2025-07-02 22:19:07 瀏覽:485
未上傳圖片 發布:2025-07-02 22:14:01 瀏覽:598
安卓qq直播怎麼分享聲音 發布:2025-07-02 22:13:21 瀏覽:249
安卓系統怎麼刷機清除內存 發布:2025-07-02 22:08:19 瀏覽:696
安卓手機6位數密碼有多少組 發布:2025-07-02 21:50:31 瀏覽:797
存儲卡視頻多了 發布:2025-07-02 21:49:40 瀏覽:850
ajax無刷新上傳圖片 發布:2025-07-02 21:32:56 瀏覽:117
編譯器不認pow函數 發布:2025-07-02 21:27:04 瀏覽:339
w10隱藏文件夾 發布:2025-07-02 21:27:03 瀏覽:534
電腦d盤拒絕訪問 發布:2025-07-02 21:27:02 瀏覽:779