How to create arrays of every foreach loop key
<p>I want to create array after every foreach loop entry.</p>

<pre><code>    foreach ($cdatos as $key =&gt; $value)
    {
        $chakde .= "array('".$key."',".$value."),";
    }

$p-&gt;data = array(array(rtrim($chakde,',')));
</code></pre>

<p>In the place of "$chakde" i want the 'array("abc",12),array("xyz",20)'. But right now my above logic is not working because its considering array as a comment. I want the data like:</p>

<pre><code>$p-&gt;data = array(array(array('Heavy Industry', 12),array('Retail', 9), array('Light Industry', 14), array('Out of home', 16),array('Commuting', 7), array('Orientation', 9)));
</code></pre>

<p>Please help me.</p>