title: PHP - indent block of html
body: <p>Let's say I have the following code:</p>
  
  <pre><code>&lt;?php
  echo "&lt;div id=\"root\"&gt;";
  echo "&lt;div id=\"child_of_root\"&gt;";
  echo "&lt;img src=\"picture1.png\"&gt;";
  echo "&lt;img src=\"picture2.png\"&gt;";
  echo "&lt;img src=\"picture3.png\"&gt;";
  echo "&lt;img src=\"picture4.png\"&gt;";
  echo "&lt;img src=\"picture5.png\"&gt;";
  echo "&lt;/div&gt;";
  echo "&lt;/div&gt;";
  ?&gt;
  </code></pre>
  
  <p>If I ran this the following HTML would be rendered all inline without any line breaks:</p>
  
  <pre><code>&lt;div id="root"&gt;&lt;div id="child_of_root"&gt;&lt;img src="picture1.png"&gt;&lt;img src="picture2.png"&gt;&lt;img src="picture3.png"&gt;&lt;img src="picture4.png"&gt;&lt;img src="picture5.png"&gt;&lt;/div&gt;&lt;/div&gt;
  </code></pre>
  
  <p>If I ran the following code:</p>
  
  <pre><code>&lt;?php
  echo "&lt;div id=\"root\"&gt;\n";
  echo "\t"."&lt;div id=\"child_of_root\"&gt;\n";
  echo "\t\t"."&lt;img src=\"picture1.png\"&gt;"."\n";
  echo "\t\t"."&lt;img src=\"picture2.png\"&gt;"."\n";
  echo "\t\t"."&lt;img src=\"picture3.png\"&gt;"."\n";
  echo "\t\t"."&lt;img src=\"picture4.png\"&gt;"."\n";
  echo "\t\t"."&lt;img src=\"picture5.png\"&gt;"."\n";
  echo "\t"."&lt;/div&gt;"."\n";
  echo "&lt;/div&gt;";
  ?&gt;
  </code></pre>
  
  <p>It wound render the following beautiful HTML:</p>
  
  <pre><code>&lt;div id="root"&gt;
    &lt;div id="child_of_root"&gt;
      &lt;img src="picture1.png"&gt;
      &lt;img src="picture2.png"&gt;
      &lt;img src="picture3.png"&gt;
      &lt;img src="picture4.png"&gt;
      &lt;img src="picture5.png"&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Is there a way I could achieve these beautiful indents without having to put <code>\t</code> before every line I want to indent. I mean so that I can indent a block instead of one line.</p>