wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
_http_build_query is private and should not be used in themes or plugins directly.
_http_build_query › WordPress Function
Seit3.2.0
Veraltetn/v
› _http_build_query ( $data, $prefix = null, $sep = null, $key = '', $urlencode = true )
| Zugriff: |
|
| Parameter: (5) |
|
| Siehe: | |
| Gibt zurück: |
|
| Definiert in: |
|
| Codex: |
From php.net (modified by Mark Jaquith to behave like the native PHP5 function).
Ähnliche Funktionen: build_query, _wp_filter_build_unique_id, wp_http_validate_url, _wp_upload_dir, wp_reset_query
Quellcode
function _http_build_query( $data, $prefix = null, $sep = null, $key = '', $urlencode = true ) {
$ret = array();
foreach ( (array) $data as $k => $v ) {
if ( $urlencode ) {
$k = urlencode( $k );
}
if ( is_int( $k ) && null !== $prefix ) {
$k = $prefix . $k;
}
if ( ! empty( $key ) ) {
$k = $key . '%5B' . $k . '%5D';
}
if ( null === $v ) {
continue;
} elseif ( false === $v ) {
$v = '0';
}
if ( is_array( $v ) || is_object( $v ) ) {
array_push( $ret, _http_build_query( $v, '', $sep, $k, $urlencode ) );
} elseif ( $urlencode ) {
array_push( $ret, $k . '=' . urlencode( $v ) );
} else {
array_push( $ret, $k . '=' . $v );
}
}
if ( null === $sep ) {
$sep = ini_get( 'arg_separator.output' );
}
return implode( $sep, $ret );
}