The function below facilitates the process of converting an array to a string. Very useful for building SQL insert queries with arrays of data. <?php function array2str($array, $pre = ”, $pad = ”, $sep = ‘, ‘) { $str = ”; if(is_array($array)) { if(count($array)) { foreach($array as $v) { $str .= $pre.$v.$pad.$sep; } $str = [...]