PHP parse_url()

Get the host, path or query of a URL with parse_url(), and rebuild URLs with http_build_query().

8 min readUpdated October 2026
Was this page helpful?
Share:

Try it yourself

Put this into practice with URL Editor

Open URL Editor