如何用target ='_ blank'打开一个新窗口?我的代码不起作用

Ste*_*ven 2 html php layout

$html=<<<html
<tr><td>$i.<a href="offtask.php?taskid=$taskid target='_blank' ">$title</a></td><td>$count</td><td class="nowrap">$locationtext</td></tr>
html;
echo $html;
Run Code Online (Sandbox Code Playgroud)

如何在上面的代码中打开一个新窗口?target='_blank'不起作用.

Asa*_*aph 10

您的target属性卡在href属性中.试试这个:

$html=<<<html
<tr><td>$i.<a href="offtask.php?taskid=$taskid" target="_blank">$title</a></td><td>$count</td><td class="nowrap">$locationtext</td></tr>
html;
echo $html;
Run Code Online (Sandbox Code Playgroud)