我正在尝试找出我的php会话的最大时间(我不能访问cpanel或php.ini文件)。我正在尝试使用这段代码,但它没有打印出任何东西(除了'hello')。怎么了?
<?php
session_start();
error_reporting(E_ALL);
ini_set("error_reporting",1);
// Get the current Session Timeout Value
$currentTimeoutInSecs = ini_get(’session.gc_maxlifetime’);
print "hello " . $currentTimeoutInSecs;
?>发布于 2013-03-19 09:26:47
您使用的引号种类错误,请使用单引号或双引号:
$currentTimeoutInSecs = ini_get('session.gc_maxlifetime');发布于 2013-03-19 09:28:03
在代码中使用单勾(而不是单引号):
<?php
session_start();
error_reporting(E_ALL);
ini_set("error_reporting",1);
// Get the current Session Timeout Value
$currentTimeoutInSecs = ini_get('session.gc_maxlifetime');
print "hello " . $currentTimeoutInSecs;
?>输出:
问候84600
https://stackoverflow.com/questions/15489931
复制相似问题