如何给php代码链接?

时间:2014-03-19 08:36:34

标签: php

我需要提供php代码的链接

'label' => $this->__('Best Sellers')

上述链接

我试过像这样给予

echo  <a href="http://new-design.html> $this->__('New Design') </a>

但它没有用

1 个答案:

答案 0 :(得分:4)

应该是

echo "<a href='new-design.html'>".$this->__('New Design')."</a>";

您错过了.的PHP字符串连接(Look at this link for more info

您还错过了>元素的结束a

请注意:

$this->__('Text here')

仅在某些框架中可用,并且不能在普通 php中使用。如果这不起作用,请尝试:

echo "<a href='new-design.html'>New Design</a>";