Jump to content

[SOLVED] need help with an array and comma


work_it_work

Recommended Posts

here's the scenario:

 

<?php $array = array($a,$b,$c,$d,$e,$f); // $a $b $c $d $e $f are variables passed from a submitted form
$implode_array = (",",$array);
print_r ($implode_array);?>

 

will look like this: ,,,,,,,, if there is no values in the $a $b $c $d $e $f variables....

 

in case variable $b and $e have values the print_r ($implode_array) will look like this: ,b,,,e,,

how can i get rid of the empty comma's ? to make it look like b,e nothing else ?

all the array must be inserted in one mysq field ...

 

waiting for suggestions

thanks in advance!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.