2015-08-26 98 views
0

这里是PHP脚本需要一个帮助PHP编码

<h1><?php if(isset($this->movie['title'])): echo $this->movie['title']; endif;?></h1>

它仅显示VS标题

我想加入换句话说标题 之前,所以我尝试这

<h1><?php if(isset($this->movie['title'])): echo Watch $this->movie['title']; endif;?></h1> 

但不工作可以任何一个请告诉我这

回答

4

一个小的语法修正的解决方案, 试试这个

<h1><?php if(isset($this->movie['title'])): echo "Watch". $this->movie['title']; endif;?></h1> 
+0

Thankx如需帮助曾任职添加引号 –

1

你用错误的语法。使用此

<h1><?php 
if(isset($this->movie['title'])) 
    echo "Watch " . $this->movie['title'];?></h1> 
0

你忘了在WATCH

<h1><?php 
if(isset($this->movie['title'])) 
    echo "Watch". $this->movie['title']; endif;?> 
</h1>