_http_build_query example


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

/** * From php.net (modified by Mark Jaquith to behave like the native PHP5 function). * * @since 3.2.0 * @access private * * @see https://www.php.net/manual/en/function.http-build-query.php * * @param array|object $data An array or object of data. Converted to array. * @param string $prefix Optional. Numeric index. If set, start parameter numbering with it. * Default null. * @param string $sep Optional. Argument separator; defaults to 'arg_separator.output'. * Default null. * @param string $key Optional. Used to prefix key name. Default empty string. * @param bool $urlencode Optional. Whether to use urlencode() in the result. Default true. * @return string The query string. */

        }
    }
    
    /** * Essentially a copy of WP's build_query but one that doesn't expect pre-urlencoded values. * * @param array $args An array of key => value pairs * @return string A string ready for use as a URL query string. */
    public static function build_query( $args ) {
        return _http_build_query( $args, '', '&' );
    }

    /** * Log debugging info to the error log. * * Enabled when WP_DEBUG_LOG is enabled (and WP_DEBUG, since according to * core, "WP_DEBUG_DISPLAY and WP_DEBUG_LOG perform no function unless * WP_DEBUG is true), but can be disabled via the akismet_debug_log filter. * * @param mixed $akismet_debug The data to log. */
    
Home | Imprint | This part of the site doesn't use cookies.