$base_url = "https://www.example.com"; $page = "index.php"; $id = 123; $url = "{$base_url}/{$page}?id={$id}"; echo $url;This code will output the URL: https://www.example.com/index.php?id=123 The package library used in this example could be any PHP library that provides functions for building URLs. Some popular options include the Symfony Routing Component and the Laravel URL Helper library.