为什么php中有句号 [英] why are there periods in php
本文介绍了为什么php中有句号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能的重复:
有什么作用句点"字符 (.) 表示如果在 php 字符串中间使用?
正如标题所说,为什么后面的代码中包含句点?
As the title says, why are the periods included in the code that follows?
require("mod/".$modarrayout."/bar.php");
显然,这是因为变量在字符串之间,但引号不应该解决这个问题吗?只是想知道澄清一下我将来做的编码.
Obviously, it's because the variable is between strings, but shouldn't the quotes have taken care of that? Just want to know to clarify for coding that I do in the future.
推荐答案
在 PHP 中,句号是连接运算符.将句点放入告诉 PHP 将 "mod/"
连接到 $modarrayout
,然后将结果字符串连接到 "/bar.php"
.请参阅此页面:
In PHP, the period is the concatentation operator. Putting the periods in tells PHP to concatenate "mod/"
to $modarrayout
and then concatenate the resulting string to "/bar.php"
. See this page:
http://www.php.net/manual/en/language.operators.string.php
这篇关于为什么php中有句号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文