WordPress at a glance

build_query() WP 1.0

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.000001s = speed of light | 50000 times = 0.05s = 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: wp-includes/functions.php WP 5.2.2

<?php
function build_query( $data ) {
	return _http_build_query( $data, null, '&', '', false );
}

Related Functions

From tag: Link (URL)

More from category: Helper Functions

No comments
    Hello, !     Log In . Register