PHP 同名变量

编程入门 行业动态 更新时间:2024-10-24 01:48:24
本文介绍了PHP 同名变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在尝试将我用 PHP 制作的登录系统与 PHPBB 登录系统集成.我的问题是我包含的 PHP 登录文档包含一个名为 $user 的类,但我的登录系统也使用 $user .例如,我的登录函数在名为 $user 的类中执行,而 phpbb 登录类是 $user->login

I am trying to integrate my login system made with PHP with the PHPBB Login system. My problem is that I am including the PHP login document which contains a class called $user but my login system uses $user as well. e.g My function for login is executing inside a class called $user and the phpbb login class is $user->login

是否可以加载 phpbb 文档,并在一种单独的环境"中登录到我的主网站?

Is it possible to load the phpbb document, and login in a separate kind of "environment" to my main website?

如果您需要更多信息,请告诉我

If you need any more info just let me know

推荐答案

您可以在函数中运行您的代码.如果您不明确告诉函数,则不会传递全局变量;)

You could run your code in a function. Functions aren't passed global variables if you don't explicitly tell them ;)

这篇关于PHP 同名变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-28 06:59:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1169698.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:变量   PHP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!