I have done most of the dirty work:
adding checkboxes and using "serialize()" to add it to the database, then then calling "unserialize()" to parse the data... with desired seperation**...
**desired separation = Using commas
However, how can I remove a comma after the last word from the database?
Here's how I am "parsing" out of the database:
Code: Select all
$getuhf = unserialize($data['user_favanimals']);
foreach ($getuhf as $listuhf)
{
echo $listuhf.', ';
}Code: Select all
echo $listuhf.', ';When viewed, I get:
Notice the comma after Fox... I would like to limit the comma insertion to the second to last word... i.e., it should not insert comma after donkey.Lion, Tiger, Donkey, Fox,
Thank You in Advance
-Matt