How can you extract the last part of a URL string in PHP?

To extract the last part of a URL string in PHP, you can use the `basename()` function. This function returns the last component of the path, which in this case would be the last part of the URL. By passing the URL string to `basename()`, you can easily extract the desired part.

$url = "https://www.example.com/some-page";
$lastPart = basename($url);
echo $lastPart; // Output: some-page