How can variables be used in formulating URLs in PHP?
To use variables in formulating URLs in PHP, you can concatenate the variable with the rest of the URL string using the dot (.) operator. This allows you to dynamically generate URLs based on the value of the variable. Example:
$id = 123;
$url = "https://www.example.com/page.php?id=" . $id;
echo $url;