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

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

WBOY
Release: 2016-06-13 13:01:22
Original
932 people have browsed it

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

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

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template