http_build_url
http_build_url copied to clipboard
handle relative urls (and use empty)
Do not add leading slash to path if host is not set or empty (see also #14).
Be careful, empty returns true for "0". Having an url of the format http://example.com#0 must be handled for example.
@kolesar-andras see #14 .
http_build_url('https://www.google.com', [ 'query' => 'test=1', ], HTTP_URL_JOIN_QUERY);
Shouldn't this add the / to path even if it's empty?