Home > Backend Development > PHP Tutorial > 不能修改常量的值?该怎么解决

不能修改常量的值?该怎么解决

WBOY
Release: 2016-06-13 13:42:27
Original
972 people have browsed it

不能修改常量的值?
define('SESS_ID', $sess->get_session_id());

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
if(empty(SESS_ID))
{
 SESS_ID = 'xxwe';
}

Copy after login

为什么报错啊

------解决方案--------------------
PHP code

define('SESS_ID', $sess->get_session_id());

#==============================

if ( !defined('SESS_ID') ) {
    echo "木有定义哦~";
    define('SESS_ID', 'xxwe');
} <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template