How can parameters be effectively added to a URL in PHP?

To add parameters to a URL in PHP, you can use the `http_build_query()` function to build a query string from an associative array of parameters. This function properly encodes the parameters and appends them to the URL. This is a convenient and secure way to pass data between pages in a web application.

$params = array(
    'param1' => 'value1',
    'param2' => 'value2'
);

$url = 'http://example.com/page.php?' . http_build_query($params);

echo $url;