Hướng dẫn how do i get the url at the end of php? - làm cách nào để lấy url ở cuối php?
Tách nó ra và nhận phần tử cuối cùng: Show
Chỉnh sửa: Để hỗ trợ các URL chính tắc kiểu Apache,
Một ví dụ khác mà tôi có thể coi là dễ đọc hơn là (demo):
Ví dụ này cũng có tính đến để chỉ làm việc trên đường dẫn của URL. Một bản chỉnh sửa khác (nhiều năm sau), chính quy hóa và sử dụng thay thế UTF-8 dễ dàng (thông qua biểu thức thông thường của PCRE trong PHP):edit (years after), canonicalization and easy UTF-8 alternative use included (via PCRE regular expression in PHP):
Điều này khá thô nhưng cho thấy cách bọc điều này trong một cuộc gọi (Php 4, Php 5, Php 7, Php 8) parse_url - phân tích một url và trả về các thành phần của nó — Parse a URL and return its components Sự mô tảparse_url (chuỗi Hàm này không có nghĩa là để xác nhận URL đã cho, nó chỉ chia nó thành các phần được liệt kê dưới đây. Các URL một phần và không hợp lệ cũng được chấp nhận, parse_url () cố gắng hết sức để phân tích chính xác chúng.parse_url() tries its best to parse them correctly. Thông số 1URL để phân tích. 2Chỉ định một trong 3, 4, 5, 6, 7, 8, 9 hoặc 0 để lấy chỉ một thành phần URL cụ thể là một chuỗi (ngoại trừ khi 5 được đưa ra, trong trường hợp đó sẽ là giá trị trả về). 3, 4, 5, 6, 7, 8, 9 or 0 to retrieve just a specific URL component as a string (except when 5 is given, in which case the return value will be an int). Trả về giá trịTrên các URL bị dị dạng nghiêm trọng, parse_url () có thể trả về 2.parse_url() may return 2. Nếu tham số 2 bị bỏ qua, một mảng kết hợp sẽ được trả về. Ít nhất một yếu tố sẽ có mặt trong mảng. Các khóa tiềm năng trong mảng này là:array is returned. At least one element will be present within the array. Potential keys within this array are:
Nếu tham số 2 được chỉ định, parse_url () trả về một chuỗi (hoặc int, trong trường hợp 5) thay vì một mảng. Nếu thành phần được yêu cầu không tồn tại trong URL đã cho, 8 sẽ được trả về. Kể từ Php 8.0.0, parse_url () phân biệt các truy vấn và các đoạn trống vắng mặt và trống:parse_url() returns a string (or an int, in the case of 5) instead of an array.
If the requested component doesn't exist within the given URL, 8 will be returned. As of PHP 8.0.0, parse_url() distinguishes absent and empty queries and fragments: http://example.com/foo → query = null, fragment = null http://example.com/foo? → query = "", fragment = null http://example.com/foo# → query = null, fragment = "" http://example.com/foo?# → query = "", fragment = "" Trước đây tất cả các trường hợp dẫn đến truy vấn và đoạn là 8. 8. Lưu ý rằng các ký tự điều khiển (xem ctype_cntrl ()) trong các thành phần được thay thế bằng dấu gạch dưới ( 0).ctype_cntrl()) in the
components are replaced with underscores ( 0). Thay đổi
Hàm này không có nghĩa là để xác nhận URL đã cho, nó chỉ chia nó thành các phần được liệt kê dưới đây. Các URL một phần và không hợp lệ cũng được chấp nhận, parse_url () cố gắng hết sức để phân tích chính xác chúng.Thông sốparse_url() example 1
1array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor" URL để phân tích.parse_url() example with missing scheme 2
1URL để phân tích. $end = end(explode('/', rtrim($url, '/'))); # or: $end = array_slice(explode('/', rtrim($url, '/')), -1)[0]; 2 Chỉ định một trong Trả về giá trịfilter_var() with the
Sơ đồ - ví dụ: HTTP
đoạn - sau khi Hashmark Nếu tham số 4 5 6 7 Trước đây tất cả các trường hợp dẫn đến truy vấn và đoạn là Lưu ý rằng các ký tự điều khiển (xem ctype_cntrl ()) trong các thành phần được thay thế bằng dấu gạch dưới ( 8 9http://example.com/foo → query = null, fragment = null http://example.com/foo? → query = "", fragment = null http://example.com/foo# → query = null, fragment = "" http://example.com/foo?# → query = "", fragment = ""0 http://example.com/foo → query = null, fragment = null http://example.com/foo? → query = "", fragment = null http://example.com/foo# → query = null, fragment = "" http://example.com/foo?# → query = "", fragment = ""1 Thay đổi ¶ Phiên bản http://example.com/foo → query = null, fragment = null http://example.com/foo? → query = "", fragment = null http://example.com/foo# → query = null, fragment = "" http://example.com/foo?# → query = "", fragment = ""2 http://example.com/foo → query = null, fragment = null http://example.com/foo? → query = "", fragment = null http://example.com/foo# → query = null, fragment = "" http://example.com/foo?# → query = "", fragment = ""3 http://example.com/foo → query = null, fragment = null http://example.com/foo? → query = "", fragment = null http://example.com/foo# → query = null, fragment = "" http://example.com/foo?# → query = "", fragment = ""4 http://example.com/foo → query = null, fragment = null http://example.com/foo? → query = "", fragment = null http://example.com/foo# → query = null, fragment = "" http://example.com/foo?# → query = "", fragment = ""5 http://example.com/foo → query = null, fragment = null http://example.com/foo? → query = "", fragment = null http://example.com/foo# → query = null, fragment = "" http://example.com/foo?# → query = "", fragment = ""6parse_url () bây giờ sẽ phân biệt các truy vấn và các mảnh trống vắng mặt và trống rỗng. Ví dụ ¶ Ví dụ #1 ví dụ parse_url () http://example.com/foo → query = null, fragment = null http://example.com/foo? → query = "", fragment = null http://example.com/foo# → query = null, fragment = "" http://example.com/foo?# → query = "", fragment = ""8 http://example.com/foo → query = null, fragment = null http://example.com/foo? → query = "", fragment = null http://example.com/foo# → query = null, fragment = "" http://example.com/foo?# → query = "", fragment = ""9 array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 Ví dụ trên sẽ xuất ra: ¶ Ví dụ #2 Một ví dụ parse_url () với sơ đồ thiếu array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"1 Ghi chú array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"2 array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"3 array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"4 array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"5 Thận trọng ¶ Hàm này có thể không cung cấp kết quả chính xác cho các URL tương đối hoặc không hợp lệ và kết quả thậm chí có thể không phù hợp với hành vi chung của máy khách HTTP. Nếu các URL từ đầu vào không tin cậy cần phải được phân tích cú pháp, cần xác thực thêm, ví dụ: bằng cách sử dụng Filter_var () với bộ lọc array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"6 array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"7 array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"8 array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 Ghi chú: ¶ Hàm này được dự định cụ thể cho mục đích phân tích các URL và không phải URI. Tuy nhiên, để tuân thủ các yêu cầu tương thích ngược của PHP, nó tạo ra một ngoại lệ cho tệp: // Sơ đồ trong đó các dấu gạch chéo ba (tệp: /// ...) được cho phép. Đối với bất kỳ chương trình nào khác, điều này là không hợp lệ. array(3) { ["host"]=> string(15) "www.example.com" ["path"]=> string(5) "/path" ["query"]=> string(17) "googleguy=googley" }0 array(3) { ["host"]=> string(15) "www.example.com" ["path"]=> string(5) "/path" ["query"]=> string(17) "googleguy=googley" }1 array(3) { ["host"]=> string(15) "www.example.com" ["path"]=> string(5) "/path" ["query"]=> string(17) "googleguy=googley" }2 array(3) { ["host"]=> string(15) "www.example.com" ["path"]=> string(5) "/path" ["query"]=> string(17) "googleguy=googley" }3 array(3) { ["host"]=> string(15) "www.example.com" ["path"]=> string(5) "/path" ["query"]=> string(17) "googleguy=googley" }4 array(3) { ["host"]=> string(15) "www.example.com" ["path"]=> string(5) "/path" ["query"]=> string(17) "googleguy=googley" }5 array(3) { ["host"]=> string(15) "www.example.com" ["path"]=> string(5) "/path" ["query"]=> string(17) "googleguy=googley" }6 array(3) { ["host"]=> string(15) "www.example.com" ["path"]=> string(5) "/path" ["query"]=> string(17) "googleguy=googley" }7 array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 Xem thêm ¶ pathInfo () - Trả về thông tin về đường dẫn tệp array(3) { ["host"]=> string(15) "www.example.com" ["path"]=> string(5) "/path" ["query"]=> string(17) "googleguy=googley" }9
array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 parse_str () - phân chia chuỗi thành các biến ¶ http_build_query () - Tạo chuỗi truy vấn được mã hóa URL
rtrim 5Dirname () - Trả về đường dẫn của thư mục cha mẹ ¶ Lưu ý rằng các ký tự điều khiển (xem ctype_cntrl ()) trong các thành phần được thay thế bằng dấu gạch dưới (
array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 Thay đổi ¶ Hàm này được dự định cụ thể cho mục đích phân tích các URL và không phải URI. Tuy nhiên, để tuân thủ các yêu cầu tương thích ngược của PHP, nó tạo ra một ngoại lệ cho tệp: // Sơ đồ trong đó các dấu gạch chéo ba (tệp: /// ...) được cho phép. Đối với bất kỳ chương trình nào khác, điều này là không hợp lệ.
preg_match 2Xem thêm ¶ pathInfo () - Trả về thông tin về đường dẫn tệp parse_str () - phân chia chuỗi thành các biến http_build_query () - Tạo chuỗi truy vấn được mã hóa URL ¶ Nếu tham số
array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 Trước đây tất cả các trường hợp dẫn đến truy vấn và đoạn là Nếu tham số
Trước đây tất cả các trường hợp dẫn đến truy vấn và đoạn là pathInfo () - Trả về thông tin về đường dẫn tệp
array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 parse_str () - phân chia chuỗi thành các biến ¶ pathInfo () - Trả về thông tin về đường dẫn tệp
$url 7parse_str () - phân chia chuỗi thành các biến ¶ http_build_query () - Tạo chuỗi truy vấn được mã hóa URL
array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 Dirname () - Trả về đường dẫn của thư mục cha mẹ ¶ Ví dụ #2 Một ví dụ parse_url () với sơ đồ thiếu 01 02 03 04 05 06 07Thư rác tại Paulisageeek dot com ¶ 15 năm trước 08 09 10 11array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 Nirazuelos tại Gmail Dot Com ¶ ¶ 13 năm trước 13 14 15array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 Need_sunny tại Yahoo Dot Com ¶ ¶ 12 năm trước 17 18 19 20Jesse tại ví dụ dot com ¶ ¶ 12 năm trước 21 22array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 Jesse tại ví dụ dot com ¶ ¶ Bramg dot net1 tại gmail dot com ¶ 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 4 năm trước ¶ 12 năm trước 41 42array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 Jesse tại ví dụ dot com ¶ ¶ Bramg dot net1 tại gmail dot com ¶ 444 năm trước ¶ điện từ tại ví dụ dot com ¶ 45 46 47 48Quản trị viên tại Griefer1999 dot uhostfull dot com ¶ ¶ 7 năm trước 49 50 51 52 53array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 Xellisx ¶ ¶ Bramg dot net1 tại gmail dot com ¶ 55 56 57array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 Xellisx ¶ ¶ Bramg dot net1 tại gmail dot com ¶ 59 60 61array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(8) "hostname" ["port"]=> int(9090) ["user"]=> string(8) "username" ["pass"]=> string(8) "password" ["path"]=> string(5) "/path" ["query"]=> string(9) "arg=value" ["fragment"]=> string(6) "anchor" } string(4) "http" string(8) "username" string(8) "password" string(8) "hostname" int(9090) string(5) "/path" string(9) "arg=value" string(6) "anchor"0 Xellisx ¶ ¶ 14 năm trước 63 64
66Boctulus @ gmail Co! M ¶ ¶ 2 năm trước 67Làm thế nào tôi có thể nhận được phần cuối cùng của URL trong PHP?Nhận phân đoạn URL cuối cùng Nếu bạn muốn nhận phân đoạn URI cuối cùng, hãy sử dụng hàm Array_Pop () trong PHP.use array_pop() function in PHP.
Làm thế nào tôi có thể nhận URL trong PHP?Các biến superglobal cần thiết, chẳng hạn như $ _server ['https'], $ _server ['request_uri'], $ _server ['server_port'] được sử dụng để có URL đầy đủ trong PHP.HTTPS biến có thể dễ dàng truy xuất giao thức trong URL của trang web.Nếu nó trả về một giá trị trên mạng, thì giao thức là HTTPS.$_SERVER['HTTPS'], $_SERVER['REQUEST_URI'], $_SERVER['SERVER_PORT'] are used to get full URL in PHP. The variable HTTPS can easily retrieve the protocol in the URL of a webpage. If it returns a value “on”, then the protocol is HTTPS.
URL PHP là gì?Định nghĩa của URL PHP.Nói chung, URL có nghĩa là người định vị tài nguyên thống nhất.Tương tự như vậy, URL trong ngôn ngữ lập trình PHP cũng giống nhau.URL không có gì ngoài một địa chỉ trang web.Nó giúp kết nối máy khách và máy chủ khi được duyệt bằng một liên kết cụ thể.Uniform Resource Locater. Likewise, URL in PHP Programming Language is also the same. URL is nothing but a website address. It helps in connecting the client and the server when browsed using a specific link.
Lệnh nào sẽ trích xuất hậu tố miền trong PHP?Hàm parse_url của PHP giúp dễ dàng trích xuất miền, đường dẫn và các thông tin hữu ích khác từ URL đầy đủ.parse_url function makes it easy to extract the domain, path and other useful bits of information from a full URL. |