evibesmusic
asked on
How to store an array as a comma seperate list in a variable?
Experts,
I have an array of information that is passed by my form. I have been able to process the form data passed using a foreach loop such as:
foreach($_POST[departments ] as $departments) {
echo $department;
echo '<br />';
}
The code above prints something like this:
department1
department2
department3
etc.
How can I store the values passed by my form in a variable? The variable should store the information in the following format:
department1, department2, department3, etc.
I have an array of information that is passed by my form. I have been able to process the form data passed using a foreach loop such as:
foreach($_POST[departments
echo $department;
echo '<br />';
}
The code above prints something like this:
department1
department2
department3
etc.
How can I store the values passed by my form in a variable? The variable should store the information in the following format:
department1, department2, department3, etc.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@hielo:
You are awesome as always. Thanks.
You are awesome as always. Thanks.
echo $myList;