It's a lot less confusing when indented properly. As for your braces, that's even more confusing, because it's still flat and you've put your braces in a configuration that doesn't make sense to anybody :-\
Printable View
It's a lot less confusing when indented properly. As for your braces, that's even more confusing, because it's still flat and you've put your braces in a configuration that doesn't make sense to anybody :-\
Yes I have already changed it to:
However, I have come across another problem going back a few steps.PHP Code:$temp = array();
foreach($id as $k => $v)
{
for($i = 0; $i < $qty[$k]; ++$i)
{
$temp[] = $v;
}
}
$cart = "array ('". implode("','",$temp)."')";
I initially created this $id array from a form that sends all the values from a hidden input field e.g.
Because the form uses $_GET, it adds each value to the url.HTML Code:<input type="hidden" name="id[]" value="$variable" />
However if I have say 200 values to get, it cuts the array off early. probably because the url if far too long.
Is there any way around this?
Use POST.
already tried that but it didn't work! thought it was something to do with the way the form values set the array.
Got it to work now though.
Thanks for all the effort! :)