php session_cache_expire函數怎麼用
php session_cache_expire函數用來傳回目前快取的到期時間,其語法為int session_cache_expire ([ string $new_cache_expire ] )。
php session_cache_expire函數怎麼用?
作用:傳回目前快取的到期時間
語法:
int session_cache_expire ([ string $new_cache_expire ] )
登入後複製
參數:
new_cache_expire, 如果給定new_cache_expire ,就使用new_cache_expire 的值設定目前快取到期時間。
說明:
session_cache_expire() 傳回 session.cache_expire 的設定值。請求開始的時候,快取到期時間會被重置為 180,並且保存在 session.cache_expire 配置項目中。因此,針對每個請求,需要在 session_start() 函數呼叫之前 呼叫 session_cache_expire() 來設定快取到期時間。
php session_cache_expire()函數使用範例
<?php /* 设置缓存限制为 “private” */ session_cache_limiter('private'); $cache_limiter = session_cache_limiter(); /* 设置缓存过期时间为 30 分钟 */ session_cache_expire(30); $cache_expire = session_cache_expire(); /* 开始会话 */ session_start(); echo "The cache limiter is now set to $cache_limiter<br />"; echo "The cached session pages expire after $cache_expire minutes"; ?>
登入後複製
輸出:
The cache limiter is now set to private The cached session pages expire after 30 minutes
登入後複製
以上是php session_cache_expire函數怎麼用的詳細內容。更多資訊請關注PHP中文網其他相關文章!
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章
<🎜>:種植花園 - 完整的突變指南
3 週前
By DDD
<🎜>:泡泡膠模擬器無窮大 - 如何獲取和使用皇家鑰匙
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
如何修復KB5055612無法在Windows 10中安裝?
3 週前
By DDD
北端:融合系統,解釋
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
Mandragora:巫婆樹的耳語 - 如何解鎖抓鉤
3 週前
By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)