Hi guys,
im working on a bit of code which for 2 days is sending me around in circles :/
what i want to do is split an array into variables, so i can dynamically create a text box.
i'm trying various methods but think im chasing my tail now.
$input_array = array($forSplitProduct);
print_r($input_array);
echo '<br>';
echo '<br>';
list($a) = $input_array;
//echo $a;
for($i = 0; $i < count($a); $i++){
// print_r($a);
$b = explode(",", $a);
// print_r($b);
for($i = 0; $i < count($b); $i++){
print_r($b[$i]);
}
}
echo '<br>';
echo '<br>';
$b = explode(",", $a);
print_r($b);
that code outputs:Array ( [0] => 1 Tonne Sand,1 Tonne Chippings, )
1 Tonne Sand1 Tonne Chippings
Array ( [0] => 1 Tonne Sand [1] => 1 Tonne Chippings [2] => )
what i would like it to do is each item, in this case "1 tonne sand" "1 tonne chippings" to be its own textbox, so:
<input name="item" type="text" value="1 tonne sand" />
<input name="item" type="text" value="1 tonne chippings" />
any ideas?
many thanks
Ade