Add HTML to the page using a PHP Class
When it comes to outputting HTML from PHP, there are a couple of alternatives:


Using a MVC framework which will separate the logic (Controller) from the data (Model) and the output (View).
Include files that contains HTML, and that can use some PHP as well ("Templates"). MVC frameworks normally makes use of this.
For short HTML, I believe there is nothing that beats using PHP's echo function and write the HTML you want manually.


A big problem with your current function is that to output several HTML tags, you'd have to write things that actually belongs together very far apart. For example: 

addHTML(array("p", "p"), 
  array('class="some"', 'class="other"'), 
  array("Lorem ipsum", "dolor sit amet"));


It's not very readable to see that one tag will become &lt;p class="some"&gt;Lorem ipsum&lt;/p&gt; and the other &lt;p class="other"&gt;dolor sit amet&lt;/p&gt;.

If you really really want to have some self-written PHP function for this, then I suggest putting things that belong together, together. Something like this:

addHTML(array(array("p", "class" =&gt; "some", "Lorem ipsum"), 
             array("p", "class" =&gt; "other", "dolor sit amet")));


However, simply writing this would be so much simpler, and a whole lot easier to read: (Especially for people who are used to reading HTML)

echo '&lt;p class="some"&gt;Lorem ipsum&lt;/p&gt;';
echo '&lt;p class="other"&gt;dolor sit amet&lt;/p&gt;';


(My PHP is a bit rusty but I hope you get the idea)