In php I have the following array:
$car[] = array ("id"=>"1", "brand"=>"Audi", "price"=>"7000");
$car[] = array ("id"=>"9", "brand"=>"Merc", "price"=>"9000");
With this array I would like to build the following query string:
&brand0=Audi&brand1=Merc&id0=1&id1=9&price0=7000&price0=9000
How can I go about doing this?
Please note that the array may have more results than just the 2 rows, and so that the built querystring should be able to cope with it (also the results being used in this example may vary).
Thanks
This will go through, and create the keys with the number on them, and then glue it all together at the end to give you the
$stringthat you were wanting. It will also, just for cleanliness, not have an extra & at the start or end that you might get if you simply append.