内联 =$GLOBAL?> 的意图是什么? PHP 中的指令?是降价吗?
我正在开发一个 PHP 项目,该项目使用导致错误的(反)约定,并且我不太确定它想要实现什么,所以修复它很困难..
该项目确实使用了 markdown,我在运行时包含了它......但我在任何地方都找不到提及此语法,包括扩展文档,所以,我在这里..关于这个语法是什么的任何想法试图完成?
原始开发人员使用短标签并没有帮助(不要这样做,人们)..但是这里是..这是 导致的问题..
<p>[<a href="<?=$PHP_SELF?>">categories</a>]
[<a href="<?=$PHP_SELF?>?index">index</a>]
[<a href="<?=$PHP_SELF?>?all">all (<?=$notes_count?>)</a>]
[<a href="<?=$PHP_SELF?>?latest">latest</a>]</p>
I am working on a PHP project that is using an (anti)-convention that is causing errors, and I'm not quite sure what it is trying to achieve, so fixing it is difficult..
The project does use markdown, which I have included at runtime… But I can't find mention of this syntax anywhere, including the extended documentation, so, here I am.. Any ideas as to what is this syntax trying to accomplish?
It doesn't help that the original developer used short tags (don't do that, people).. but here goes.. It is the <?=$PHP_SELF?>
that is causing problems..
<p>[<a href="<?=$PHP_SELF?>">categories</a>]
[<a href="<?=$PHP_SELF?>?index">index</a>]
[<a href="<?=$PHP_SELF?>?all">all (<?=$notes_count?>)</a>]
[<a href="<?=$PHP_SELF?>?latest">latest</a>]</p>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为应该是:
I think it should be:
这是以下内容的简写:
如果您的 php.ini 中启用了
short_open_tag
,则您的方法将有效,但否则会导致错误。据推测,
$PHP_SELF
变量在这些使用之前已被初始化,可能是$_SERVER['PHP_SELF']
的副本。如果尚未初始化,您可能需要更新代码以引用$_SERVER['PHP_SELF']
。This is a shorthand for:
Your method would work if
short_open_tag
is enabled in your php.ini, but will cause errors otherwise.Presumably, the
$PHP_SELF
variable has been initialized prior to these usages, possibly as a duplicate of$_SERVER['PHP_SELF']
. If it has not been initialized, you may want to update your code to reference$_SERVER['PHP_SELF']
.