What is the recommended method in PHP to change a specific link format to a more user-friendly one?

To change a specific link format to a more user-friendly one in PHP, you can use the `str_replace()` function to replace the specific part of the link with the user-friendly format. This function allows you to search for a specific substring within a string and replace it with another substring. By using `str_replace()`, you can easily modify the link format to make it more user-friendly.

$link = "https://www.example.com/page?id=123";
$user_friendly_link = str_replace("page?id=", "page/", $link);

echo $user_friendly_link;