Populating an object's properties with an array?
<p>I want to take an array and use that array's values to populate an object's properties using the array's keynames. Like so:</p>

<pre><code>$a=array('property1' =&gt; 1, 'property2' =&gt; 2);
$o=new Obj();
$o-&gt;populate($a);

class Obj
{
    function Populate($array)
    {
        //??
    }
}
</code></pre>

<p>After this, I now have:</p>

<pre><code>$o-&gt;property1==1
$o-&gt;property2==2
</code></pre>

<p>How would I go about doing this?</p>
