$userFullName = "John Doe"; $userLastname = ''; // split the user's full name into an array $nameArray = explode(" ", $userFullName); // get the last element of the array, which should be the user's last name $lastNameArrayIndex = count($nameArray) - 1; $userLastname = $nameArray[$lastNameArrayIndex]; // output the user's last name echo "User last name is: " . $userLastname;The package library used in this example is the PHP core library, which includes many built-in functions and methods for working with data and processing it in various ways. However, there may also be third-party libraries available that offer more specialized or advanced functionality related to retrieving and working with user data.