This is a discussion on Build GET/POST query based on associated array within the PHP Programming forums, part of the Web Development category; Hi, http_build_query - This function support PHP 5 or above versions This function is used to Generates a URL-encoded query ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi, http_build_query - This function support PHP 5 or above versions This function is used to Generates a URL-encoded query string from the associative (or indexed) array provided. Code: Syntax string http_build_query ( array $formdata [, string $numeric_prefix [, string $arg_separator]] ) ChangeLog arg_separator is added in PHP version 5.1.2 5.1.3 Square brackets are escaped. Example: Simple usage of http_build_query() PHP Code: PHP Code: Code: 0=foo&1=bar&2=baz&3=boom&cow=milk&php=hypertext+processor myvar_0=foo&myvar_1=bar&myvar_2=baz&myvar_3=boom&cow=milk&php=hypertext+processor PHP Code: HTML Code: user%5Bname%5D=Bob+Smith&user%5Bage%5D=47&user%5Bsex%5D=M& user%5Bdob%5D=5%2F12%2F1956&pastimes%5B0%5D=golf&pastimes%5B1%5D=opera& pastimes%5B2%5D=poker&pastimes%5B3%5D=rap&children%5Bbobby%5D%5Bage%5D=12& children%5Bbobby%5D%5Bsex%5D=M&children%5Bsally%5D%5Bage%5D=8& children%5Bsally%5D%5Bsex%5D=F&flags_0=CEO Example: Using http_build_query() with an object PHP Code: R.Gopi |
| Sponsored Links |
| |||
| Hi, This is very useful function. But it works for sending all the array values to the querystring. This function is very new for all including me.
__________________ With, J. Jeyaseelan Everything Possible |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Product-based Company and Projects-based Company : | vigneshgets | Software Testing | 0 | 01-15-2008 11:03 PM |
| Build | vigneshgets | Software Testing | 1 | 01-15-2008 10:00 PM |
| How to prepare Bug report for every day build? | KiruthikaSambandam | Software Testing | 2 | 08-28-2007 06:57 AM |
| What’s the difference between the System.Array.CopyTo() and System.Array.Clone() ? | Archer | C# Programming | 2 | 08-25-2007 03:00 AM |
| How to Post and get the Multidimension Array? | varghese | PHP Programming | 1 | 07-11-2007 06:06 AM |