當前位置:首頁 » 編程語言 » 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 都是正確訪問 的。

熱點內容
實測華為編譯器 發布:2024-09-19 23:50:52 瀏覽:820
linux匯總 發布:2024-09-19 23:46:39 瀏覽:452
阿里雲伺服器環境搭建教程 發布:2024-09-19 23:21:58 瀏覽:837
黃色文件夾圖標 發布:2024-09-19 23:19:22 瀏覽:684
mysql資料庫導出導入 發布:2024-09-19 23:00:47 瀏覽:183
lua腳本精靈 發布:2024-09-19 23:00:41 瀏覽:659
任務欄文件夾圖標 發布:2024-09-19 22:54:25 瀏覽:101
解壓來一波 發布:2024-09-19 22:46:36 瀏覽:933
mysqlpythonubuntu 發布:2024-09-19 22:46:27 瀏覽:501
伺服器請求獲取ip地址 發布:2024-09-19 22:33:25 瀏覽:515