The obvious solution that was first suggested was to iterate around a for..next loop checking each of the array values and concatenating it into a string. But I came up with this rather elegant solution:
Code: Select all
<?php
function not_empty($e){ return !empty($e); }
$string = implode(",",array_filter($array,"not_empty"));
?>
NB: What's up with the tags? They're not working.