Can some help me make this code backward compatible?
This code works with php 5.3 and above. I need it to work with 5.2.17.
$columns = 'col1, col2, col3';
$values = '$value1, $value2, $value3';
$result = implode(
', ',
array_map(
function ($c, $v) {
return $c . ' = ' . $v;
},
explode(',', $columns),
explode(',', $values)
)
);
var_dump($result); //this returns: col1 = $value1, col2 = $value2, col3 = $value3
Cheers.