- array_values: documentation ( source)
- array_keys: documentation ( source)
<?php
$records = array('id'=>'2','name'=>'Andi');
foreach($records as $column => $value) {
$key = ':' . $column;
$placeholders[$key] = $value;
}
$columns = array_keys($records);
$values = array_values($records);