1--TEST-- 2Test http_build_query() function: usage variations - first arguments as multidimensional array and second argument present/not present 3--CREDITS-- 4Adam Gegotek <adam [dot] gegotek [at] gmail [dot] com> 5--FILE-- 6<?php 7$mDimensional = array( 8 20, 9 5 => 13, 10 "9" => array( 11 1 => "val1", 12 3 => "val2", 13 "string" => "string" 14 ), 15 "name" => "homepage", 16 "page" => 10, 17 "sort" => array( 18 "desc", 19 "admin" => array( 20 "admin1", 21 "admin2" => array( 22 "who" => "admin2", 23 2 => "test" 24 ) 25 ) 26 ) 27); 28 29echo http_build_query($mDimensional) . PHP_EOL; 30echo http_build_query($mDimensional, 'prefix_'); 31?> 32--EXPECT-- 330=20&5=13&9%5B1%5D=val1&9%5B3%5D=val2&9%5Bstring%5D=string&name=homepage&page=10&sort%5B0%5D=desc&sort%5Badmin%5D%5B0%5D=admin1&sort%5Badmin%5D%5Badmin2%5D%5Bwho%5D=admin2&sort%5Badmin%5D%5Badmin2%5D%5B2%5D=test 34prefix_0=20&prefix_5=13&prefix_9%5B1%5D=val1&prefix_9%5B3%5D=val2&prefix_9%5Bstring%5D=string&name=homepage&page=10&sort%5B0%5D=desc&sort%5Badmin%5D%5B0%5D=admin1&sort%5Badmin%5D%5Badmin2%5D%5Bwho%5D=admin2&sort%5Badmin%5D%5Badmin2%5D%5B2%5D=test 35