title: PHP: printing array coming from a class
body: <p>I’m teaching myself php and I’m stuck with representing a data array coming from a class. 
  Here’s Myclass.php:</p>
  
  <pre><code> class Myclass
      {
  
          private $iVar1;
          private $strVar2;
  
  
  
          public function __construct() 
          {
              $this-&gt;initialize();
          }
  
  
          private function initialize()
          {
              $this-&gt;iVar1 = null;
              $this-&gt;strVar2 = null;
          }
  
          public function getParam1()
          {
              return $this-&gt;iVar1;
          }
  
  
          public function setParam1($value)
          {
              $this-&gt;iVar1 = $value;
          }
  
  
          public function getParam2()
          {
              return $this-&gt;strVar2;
          }
  
  
          public function setParam2($value)
          {
              $this-&gt;strVar2 = $value;
          }
  
  
      }
  
      class MyclassDAO
      {
  
          static public function load($oBD, $idObjet)
          {
  
              $aryM = MyclassDAO::getAryM($oBD, $idObjet);
  
              return $aryM[0];
          }
  
          static public function getAryM($oBD, $omy)
          {
              $aryCollection = array();
  
                  $sSql = 'EXEC MYDB.dbo.SELECT_MYPROCEDURE ';
  
                  if (!is_null($omy-&gt;getParam1()))
                  {
                      $sSql .=" @param1 = '".$omy-&gt;getParam1()."',";  
                  }
                  if (!is_null($omy-&gt;getParam2()))
                  {
                      $sSql .=" @param2 = '".$omy-&gt;getParam2()."',";   
                  }
  
                  //I delete de last ,
                  $sSql =  substr($sSql,0,strlen($sSql)-1); 
  
  
                          while ($d = $oBD-&gt;fArray()) 
                          { 
                              $omy = new GrupoAlumno();
                              $omy-&gt;setParam1($d['param1']);
                              $omy-&gt;setParam2($d['param2']);
                              $aryCollection[] = $omy;
                          }
  
              return $aryCollection;
          }
  
  
  
      }
  </code></pre>
  
  <p>And here’s my php file: </p>
  
  <pre><code>require_once "Myclass.php";
  $var1=1;
  $var2=’Y’;    
   $om = new Myclass();
              $om-&gt;setParam1($var1);
              $om-&gt;setParam2($var2);
              $omDAO = new MyclassDAO();
              $ary= $omDAO-&gt;load($myObjDB, $om);
  // the printing of the info here
  </code></pre>
  
  <p>The info returned by the class has this structure: </p>
  
  <pre><code>$ary: array=
  0:object(Myclass)=
  iVar1:long=113
  strVar2:string=SOMEINFO
  1: object(Myclass)=
  iVar1:long=114
  strVar2:string=SOMEINFO2
  </code></pre>
  
  <p>How do I print it in my php file?? </p>
  
  <p>Thanks a lot!  </p>