How to get value from array()
<p>I have a code sample:
bank(id, name)</p>

<pre><code>function getListBank() {
        $data = array();
        $sql = 'Select id, name From bank';
        $query = mysql_query($sql);
        if(!$query) {
            echo "Error: " . mysql_error();
            exit;
        }
        while($row = mysql_fetch_object($query)) {
            $data[] = $row;
        }
        return $data;
    }
$banks = getListBank();
$convert = array();
foreach ($banks as $bank) {
    $convert[] = $bank-&gt;name;
}
foreach ($convert as $k =&gt; $v) {
    echo "key:" . $k . "value:" . $v;
}
</code></pre>

<p>I can't get value and key from array foreach. Any ideas?</p>
