title: PHP5 How to build a class with a starting array?
body: <p>I have a problem in constructing a Menu, I'd like to create a class like this:</p>
  
  <pre><code>class leftMenu{
  
  public $items;
  
      function addItem ($num){
  
          for($i = 0; $i &lt; count($num); $i++){
                $this-&gt;items[$i] += $num;
                echo $this-&gt;items[$i];
              }
  
      }
  
  public function __destruct() {
        //echo "\n&lt;/body&gt;\n&lt;/html&gt;";
      }
  
  }
  </code></pre>
  
  <p>I'd like to call the addItem like an array, example:</p>
  
  <pre><code>$menu = new leftMenu();
  $menu-&gt;addItem("one", "two", "three"); // Here 1, 2, 3 should be an array
  </code></pre>
  
  <p>I can't make it work... Please help!!!
  ND</p>