Home >Backend Development >PHP Tutorial > php代码字符串跟变量组合规范,帮小弟我看看

php代码字符串跟变量组合规范,帮小弟我看看

WBOY
WBOYOriginal
2016-06-13 13:01:22931browse

php代码字符串跟变量组合规范,帮我看看

<br />
<?php<br />
$host = $_SERVER["HTTP_HOST"];   //获取主机头<br />
include(str_replace('.yiqimai.baidu.com', '', $host ).".html");<br />
?><br />

上面是 $host.html
我现在想组合  /html/$host.html
我写的不规范,正确应该怎么写?

------解决方案--------------------
include("/html/".str_replace('.yiqimai.baidu.com', '', $host ).".html");

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn