WordPress at a glance
function is not described

_wp_translate_php_url_constant_to_key() WP 4.7.0

Translate a PHP_URL_* constant to the named array keys PHP uses.

No Hooks.

Return

String/true/false. The named key or false.

Usage

_wp_translate_php_url_constant_to_key( $constant );
$constant(int) (required)
PHP_URL_* constant.

Code of wp translate php url constant to key: wp-includes/http.php VER 5.0.3

<?php
function _wp_translate_php_url_constant_to_key( $constant ) {
	$translation = array(
		PHP_URL_SCHEME   => 'scheme',
		PHP_URL_HOST     => 'host',
		PHP_URL_PORT     => 'port',
		PHP_URL_USER     => 'user',
		PHP_URL_PASS     => 'pass',
		PHP_URL_PATH     => 'path',
		PHP_URL_QUERY    => 'query',
		PHP_URL_FRAGMENT => 'fragment',
	);

	if ( isset( $translation[ $constant ] ) ) {
		return $translation[ $constant ];
	} else {
		return false;
	}
}