我想得到页面标题.因为网站的名称将存在


I want to get page heading.in that the name of site will exist?

嗨,我正在做示例应用程序,我想有一个页面标题。。比如"www.flipkart.com"。因为网站的名称应该像"mycart.com"一样存在。这是我的一段代码。。

<div id=back style="background-color:orange;min-height:125px;min-width:75px;">
<h1 align="center">Products</h1>
</div>

那么您想将HTTP主机名放入<h1>标记中吗?$_SERVER超全局数组中提供了许多关于PHP和服务器环境的有用信息。

<h1><?php echo $_SERVER['HTTP_HOST']; ?> - Products</h1>

请注意,您应该使用CSS规则来对齐H1。

h1 {
  text-align: center;
}

您可以尝试此代码。

<div id=back style="background-color:orange;min-height:25px;min-width:100px;height:25px;width:100px;padding-top:5px;text-align:center;">
<span style="font-size:16px;font-weight:bold;">My Cart</span>
</div>