【发布时间】:2015-04-28 01:40:43
【问题描述】:
我正在一个网站上实现 phpmobilizer。我创建了一个子域“m”,其中包含一个包含以下代码的文件(这只是一个部分):
function __construct($url){
$this->url = $url;
$this->server = preg_replace('/^m\./', '', $_SERVER['SERVER_NAME']);
$this->ext = strtolower(end(explode('.', $this->url)));
$this->patterns = array();
$this->replacements = array();
$this->cookieDomain = $this->__getCookieDomain();
}
我得到的错误在第 15 行:
$this->ext = strtolower(end(explode('.', $this->url)));
严格的标准:只有变量应该在 website.com/m/phpmobilizer.class.php 第 15 行通过引用传递
这是我在 head 部分中用来将移动用户重定向到“m”子域的代码。我已经使用 Google 的移动友好测试对移动子域进行了测试,它运行正常。
【问题讨论】:
标签: php