Forum Moderators: coopster
list($test, $test1, $test2) = split('&',$_SERVER['QUERY_STRING'],count($testing));
So $test is static and $test1, $test2, $test3... is dynamic. I'm trying to pull out the info out of the QUERY_STRING. Where all the varibles have the same name. Thanks
fintan.
?item=no1&item=no2&item=no3 or more like
?item[]=no1&item[]=no2&item[]=no3 If you use the second example-type, then the item[] array has already been created and you can loop through it directly instead of needing to split() the string to create your array.
foreach ($_GET['item'] as $item) {
Note that if you set up your form (or whatever you are getting the parameters of the URI from) so that the names of the form fields include an empty array bracket, they will naturally form an array, and be separate distinct variables.
You used:
setfolder= <input name="setfolder"> <select name="setfolder" multiple> You may be able to use:
setfolder[]= <input name="setfolder[]"> <select name="setfolder[]" multiple> You seem to have a handle on it, but I thought I'd point out this little convention that makes it a bit easier. Your solution is nice, though. :)