Php 除了字符串之外,如何添加目标
我试图将target属性添加到下面的函数中,但是提示出错了,我该怎么做? 这与教育来源有关Php 除了字符串之外,如何添加目标,php,Php,我试图将target属性添加到下面的函数中,但是提示出错了,我该怎么做? 这与教育来源有关 ch ($links as $link) { $output .= "<li><a href='http://localhost/player/index.php?var=" . $link['link'] . "'>" . $link['name'] . "</a><br/></li>\n " ; ch($links作为$li
ch ($links as $link) {
$output .= "<li><a href='http://localhost/player/index.php?var=" . $link['link'] . "'>" . $link['name'] . "</a><br/></li>\n " ;
ch($links作为$link){
$output.=“
\n”;
我需要在链接后添加目标,但在接收错误中使用连续引号
ch ($links as $link) {
$output .= "<li><a href='http://localhost/player/index.php?var=" . $link['link'] . "'>target="principale"" . $link['name'] . "</a><br/></li>\n " ;
ch($links作为$link){
$output.=“
\n”;
$output.=“
\n”
1) 使用单引号避免报价问题
2) 确保目标属性位于标记内。=“2) 确保目标属性在标记中第一个代码段有效吗?第二个脚本似乎与principale周围的引号字符有一些问题——它们会破坏您正在使用的字符串文字。第一个代码段有效吗?第二个脚本与principale周围的引号字符有一些问题--他们会破坏你使用的字符串文字。
$output .= "<li><a href='http://localhost/player/index.php?var=" . $link['link'] . "' target='principale'>" . $link['name'] . "</a><br/></li>\n "