build_query()
Build URL query based on an associative and, or indexed array.
This is a convenient function for easily building url queries. It sets the separator to '&' and uses _http_build_query() function.
1 time — 0.000001 sec (speed of light) | 50000 times — 0.05 sec (speed of light) | PHP 7.2.5, WP 5.0
No Hooks.
Return
String
. URL-encoded string.
Usage
build_query( $data );
- $data(array) (required)
- URL-encode key/value pairs.
Notes
- See: _http_build_query() Used to build the query
Changelog
Since 2.3.0 | Introduced. |
Code of build_query() build query WP 6.0
function build_query( $data ) { return _http_build_query( $data, null, '&', '', false ); }