php输出的代码,如何能实现在查看源代码时,源代码有换行
如 echo '<table><tr>';
输出时查看源代码<table><tr>是连在一起的
怎么写能实现在查看源代码时是
<table>
<tr>
这样分成两行显示的效果呢?
我  echo '<table>\n<tr>' 也没用,不是显示的结果换行,是让显示的源代码中有换行,谢谢关注指点

解决方案 »

  1.   

    echo "<table>\n<tr>";//或者echo '<table>',"\n";
    echo '<tr>';
      

  2.   

    或者这样:
    echo <<<eof
    <table>
    <tr>
    eof;
      

  3.   

    echo <<<end
    <table>
    <tr>
    end;
      

  4.   

    ' 符号 内的 所有字符转换 和 变量 等等 都被解析 为 字符串!echo '<table>\n<tr>'例如 $a='abc';
     echo '<table>$a<tr>';
     输出  <table>$a<tr>而
     echo "<table>$a<tr>";
     则输出 <table>abc<tr>
      

  5.   

    echo "<table>\n<tr>";

    echo >>>n
    <table>
    <tr>
    //.....
    n;
      

  6.   

    echo >>>n
    ……
    n;
    这种形式,怎么在其中插入变量呢?
      

  7.   


    echo >>>HTML
    <div id="{$Div}"/>
    HTML;
      

  8.   

    如 echo '<table><br><tr>';
      

  9.   

    用 PHP_EOL  这个常量