在数组中的记录的开头和结尾添加引号

I have a script that generates an array of values from a POST

$values = array_values($_POST);

What I'd like to do is add a single quote ' to the beginning AND the end of each record in the array.

hint: $values = "'".$values."'";   does not work

Does anyone know how to do this?

for example if the array contains [nameFirst] => Vik [nameLast] => Grant it would replace it with [nameFirst] => 'Vik' [nameLast] => 'Grant'

any ideas?

Use http://ca2.php.net/array_map

$new_values = array_map( function($value) {
    return "'{$value}'";
}, $values);
foreach ($values as &$value) {
    $value = "'{$value}'";
}