Skip to content

Instantly share code, notes, and snippets.

@jhuttner
Created October 12, 2011 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhuttner/1282193 to your computer and use it in GitHub Desktop.
Save jhuttner/1282193 to your computer and use it in GitHub Desktop.
<?php
function splitArray($array) {
$array = $this->quoteArray($array);
$fields = array_keys($array);
$fields_with_ticks = array();
foreach($fields as $f) {
$fields_with_ticks[] = '`'.$f.'`';
}
$values = array_values($array);
return array(implode(",", $fields_with_ticks), implode(",", $values));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment