总得有个引号吧?
<span title='{$a}'></span>

解决方案 »

  1.   

    浏览器会自动截取的。
    <?php
    $title = '';
    for($i=0; $i<10000; $i++){
        $title .= '山';    
    }
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
     <head>
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <title> New Document </title>
      <meta name="Generator" content="EditPlus">
      <meta name="Author" content="">
      <meta name="Keywords" content="">
      <meta name="Description" content="">
     </head> <body>
      <span title="<?php echo $title; ?>">abc</span>
     </body>
    </html>