Displaying some value in a foreach
<p>I have this code which i am using to present my data in a table format</p>

<pre><code>&lt;style&gt;
td{
border:1px solid orange;
}
table{
border:1px solid orange;
}
&lt;/style&gt;
&lt;?php
$arr = array(
    'one' =&gt; array(
        'sidebarname' =&gt; 'first',
        'sidebarid' =&gt; 'first1'
    ),
    'two' =&gt; array(
        'sidebarname' =&gt; 'oneaa',
        'sidebarid' =&gt; 'onebb'
    ),
    'three' =&gt; array(
        'sidebarname' =&gt; 'onecc',
        'sidebarid' =&gt; 'onedd'
    ),
    'four' =&gt; array(
        'sidebarname' =&gt; 'oneee',
        'sidebarid' =&gt; 'oneff'
    ),
    'five' =&gt; array(
        'sidebarname' =&gt; 'onegg',
        'sidebarid' =&gt; 'onehh'
    ),
    'six' =&gt; array(
        'sidebarname' =&gt; 'oneii',
        'sidebarid' =&gt; 'onejj'
    )
);
echo '&lt;table&gt;';
foreach ($arr as $key =&gt; $value) {
echo '&lt;tr&gt;'.'&lt;td&gt;'."&lt;input type='text' value=$key /&gt;".'&lt;/td&gt;';

foreach ($value as $keyed=&gt; $newvalue) 
echo '&lt;td&gt;'."&lt;input type='text' value=$newvalue /&gt;".'&lt;/td&gt;';   
}

echo '&lt;/tr&gt;&lt;/table&gt;';

?&gt;
</code></pre>

<p>I am displaying the main key of each array and values of the first and second arrays.For instance</p>

<pre><code>'five' =&gt; array(
            'sidebarname' =&gt; 'onegg',
            'sidebarid' =&gt; 'onehh'
        ),
</code></pre>

<p>i am displaying five,the value of <code>sidebarname</code> and the value of <code>sidebarid</code>.This is what i am expecting in html.</p>

<p><a href="http://jsfiddle.net/83hNB/" rel="nofollow">http://jsfiddle.net/83hNB/</a> </p>

<p>How can i use foreach to display <code>sidebarid</code> as a textarea instead of the input text.</p>
