title: How to convert an array into an object using stdClass()
body: <p>I have made the following array:</p>
  
  <pre><code>$clasa = array(
          'e1' =&gt; array('nume' =&gt; 'Nitu', 'prenume' =&gt; 'Andrei', 'sex' =&gt; 'm', 'varsta' =&gt; 23),
          'e2' =&gt; array('nume' =&gt; 'Nae', 'prenume' =&gt; 'Ionel', 'sex' =&gt; 'm', 'varsta' =&gt; 27),
          'e3' =&gt; array('nume' =&gt; 'Noman', 'prenume' =&gt; 'Alice', 'sex' =&gt; 'f', 'varsta' =&gt; 22),
          'e4' =&gt; array('nume' =&gt; 'Geangos', 'prenume' =&gt; 'Bogdan', 'sex' =&gt; 'm', 'varsta' =&gt; 23),
          'e5' =&gt; array('nume' =&gt; 'Vasile', 'prenume' =&gt; 'Mihai', 'sex' =&gt; 'm', 'varsta' =&gt; 25)
  );
  </code></pre>
  
  <p>I would like to know how to convert this array into an object using stdClass(), I'm a PHP beginner, a simple example would be very helpful, I've tried searching for similar questions, but the answers are complicated and go beyond my understanding of basic classes and objects.</p>