What are some best practices for passing multiple parameters in a URL using PHP?

When passing multiple parameters in a URL using PHP, it is important to properly encode the values to prevent errors and security vulnerabilities. One common approach is to use the `http_build_query()` function to build a query string from an array of parameters. This function takes care of encoding the values and concatenating them with the appropriate delimiters.

// Example of passing multiple parameters in a URL using PHP
$params = array(
    'param1' => 'value1',
    'param2' => 'value2',
    'param3' => 'value3'
);

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

echo $url;