I'm trying to make this implode function work.
This is the form part, assume all the item has been selected.
<form method="post">
<select name="test1" multiple="multiple" id="test1">
<option value="1">item1</option>
<option value="2">item2</option>
<option value="3">item3</option>
<option value="4">item4</option>
<option value="5">item5</option>
</select>
</form>
The PHP part
<?php
$var1 = array();
$joinedString = array();
$var1 = $_POST['test1'];
$joinedString = implode(',', $var1);
?>
But The echoing part doesn't work, it gives me error, and only displaying only the first array value.
<?php
$echo $joinedString[0];
$echo $joinedString[1];
$echo $joinedString[2];
$echo $joinedString[3];
$echo $joinedString[4];
?>
Thank You guys, I'm quite new in programming. I always forgot that the code executed line by line, and always confused with variable and values, and yes, in real world I am also a clumsy & insignificant person.