Are there any specific PHP functions or methods that can help with handling URLs and routing?

When working with URLs and routing in PHP, the `parse_url()` function can be used to break down a URL into its components like scheme, host, path, etc. Additionally, the `$_SERVER['REQUEST_URI']` variable can be used to extract the requested URI from the server. Finally, using a routing library like Symfony Routing Component or FastRoute can help in defining and handling routes in a more structured way.

// Example using parse_url() function to extract URL components
$url = "https://www.example.com/page";
$parsed_url = parse_url($url);
echo $parsed_url['scheme']; // Output: https
echo $parsed_url['host']; // Output: www.example.com
echo $parsed_url['path']; // Output: /page

// Example using $_SERVER['REQUEST_URI'] to get the requested URI
$request_uri = $_SERVER['REQUEST_URI'];
echo $request_uri; // Output: /page