i think the solution is right in front of me but after trying for a few hours im at a dead end
Heres what i am trying to do..
I have a text field with a list of members which are comma separated, the amount of members can not be predetermined so has to be detected via php.
When the form is posted i need to then separate the members
i have tried, for example..
Code: Select all
// Post Members
$members = $_POST['members'];
//Calculate amount based on delimiter [,] - Works!
$amount = sizeof(explode(',',trim($members)));
//Try and separate each member - This is where i have probs
for ($x=0;$x<$amount;$x++)
{
list($member) = explode(',',trim($members[$x]));
echo $member."<br>";
}example: Should be
Member 1
Member 2
member 3
... and so on
I get
M
e
m
b
e
r
1
.... and so on
I hope you can understand this any help would be most greatful
Thanks in advance.