What are the functions parse_url and basename in PHP, and how can they be helpful in working with page names?

The functions `parse_url` and `basename` in PHP can be helpful in working with page names by allowing you to extract specific components of a URL and retrieve the base name of a file path, respectively. This can be useful when you need to manipulate or display URLs or file paths in a more user-friendly manner.

$url = "https://www.example.com/page/subpage";
$path = parse_url($url, PHP_URL_PATH);
$pageName = basename($path);

echo "URL: " . $url . "<br>";
echo "Page Name: " . $pageName;