This is easy but after one to many coffees and way to many hours, I GIVE UP.. time to move on!!
I have the following array, that I would like to add a comma after each selection except after the last. Then I like to take that list and have it named to form_fruit_trees so I can add it to the database as single line of text. This is what I have so far:
Example:
['fruit_trees']['0'] = Apples
['fruit_trees']['1'] = Peaches
['fruit_trees']['2'] = Pears
['fruit_trees']['3'] = Oranges
for ($i = 0; $i < count ($fruit_trees); $i++) {
($i ? ", " : "") . ($fruit_trees [$i]);
}
the above script creates:
Apples, Peaches, Pears, Oranges
now I am having a problem taking the above and creating it into a string so i can add it to the database.
and do the opposite, take it from the database as
Apples, Peaches, Pears, Oranges and change it back into an array so it places the users select boxes.
Hope this makes sense, meanwhile back I go at it again