如何调用会话变量? [英] How to call the session variable?

查看:61
本文介绍了如何调用会话变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




正如您所建议的那样,我没有使用session_register()。在一个

文件中,我执行了这样的行:

$ _session [''ex''] = 2.0;


然后,在另一个文件中,我执行了以下行:

$ ex = 3.0。


而且我注意到之前的任务被看到了/>
无处不在(在其他页面上)。所以,据我所知,在$ _session [''ex''] = 2.0的
使用后,$ ex变量成为会话

变量。而且,$ ex和

$ _session [''ex'']变量是同一个变量!换句话说,我只需要第一次拨打$ _session [''ex'']。我做了一次

后我只能使用$ ex(而不是$ _session [''ex''])。这是真的吗?

Hi,

As you have recommended I did not use the session_register(). In one
file I have executed such line:
$_session[''ex''] = 2.0;

Then, in another file, I have executed the following line:
$ex = 3.0.

And than I have noticed that the previous assignment is seen
everywhere (on other pages). So, as far as I understood, after the
usage of $_session[''ex''] = 2.0, the $ex variable becomes a session
variable. Moreover, $ex and
$_session[''ex''] variables are the same variable! In other words, I
have to call $_session[''ex''] just the first time. After I did it once
I can use just $ex (instead of $_session[''ex'']). Is that true?

推荐答案

_session [''ex''] = 2.0;


然后,在另一个文件中,我执行了以下行:
_session[''ex''] = 2.0;

Then, in another file, I have executed the following line:


ex = 3.0。


而且我注意到了之前的行在任何地方看到分配

(在其他页面上)。所以,据我所知,在

使用
ex = 3.0.

And than I have noticed that the previous assignment is seen
everywhere (on other pages). So, as far as I understood, after the
usage of


_session [''ex''] = 2.0后,
_session[''ex''] = 2.0, the


这篇关于如何调用会话变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆