想用ECHO 输入 后面这些内容 <tr onMouseOver="this.style.backgroundColor='#F5F5F5'" onMouseOut="this.style.backgroundColor=''">结果由于backgroundColor 他也调用过'所以
echo '<tr onMouseOver="this.style.backgroundColor='#F5F5F5'" onMouseOut="this.style.backgroundColor=''">'输出就有问题 应该如何改动~!

解决方案 »

  1.   

    echo " <tr onMouseOver=\"this.style.backgroundColor='#F5F5F5'\" onMouseOut=\"this.style.backgroundColor=''\">" 
    试试...
      

  2.   

    $str='';
    $str=<<<EOT
    <tr onMouseOver="this.style.backgroundColor='#F5F5F5'" onMouseOut="this.style.backgroundColor=''"> 
    EOT;
    echo $str;
      

  3.   

    把echo里面的双引号全部改成单引号就行了
      

  4.   

    转义
    $str="<tr onMouseOver=\"this.style.backgroundColor='#F5F5F5'\" MouseOut=\"this.style.backgroundColor=''\">";  echo htmlspecialchars($str);
      

  5.   

    echo '<tr onMouseOver="this.style.backgroundColor=\'#F5F5F5\'" onMouseOut="this.style.backgroundColor=\'\'">';
    最佳