日期:2014-05-16  浏览次数:20313 次

PHP 字符串连接,求大神编辑,解答
echo "<a href="#" plain="true" onclick="newUser('news','项目公告','home/news/news.php?id= . $row[news_id] ')>". $row["news_title"] . "</a>";


要把这个输出出来,改了部分,单引号双引号嵌套绕晕了,该怎么改?求指教
------解决方案--------------------
echo "<a href=\"#\" plain=\"true\" onclick=\"".newUser('news','项目公告','home/news/news.php?id= . $row[news_id] ')."\">". $row["news_title"] . "</a>";
------解决方案--------------------

$args = "'news','项目公告','home/news/news.php?id=".$row[news_id]."'";
echo '<a href="#" plain="true" onclick=" newUser('.$args.')" >'.$row['news_title'].'</a>';

------解决方案--------------------
echo "<a href='#' plain='true' onclick=\'newUser('news','项目公告','home/news/news.php?id= ".$row['news_id']."')'>". $row['news_title'] . "</a>";

------解决方案--------------------
本帖最后由 xuzuning 于 2014-02-28 09:26:01 编辑
echo <<< HTML
<a href="#" plain="true" onclick="newUser('news','项目公告','home/news/news.php?id=$row[news_id] ')">$row[news_title]</a>
HTML;


------解决方案--------------------
echo "<a href='#' plain='true' onclick='".'newUser("news","项目公告","home/news/news.php?id='.$row['news_id'].'")'."'>". $row['news_title'] . "</a>";
改了下