- array_merge: documentation ( source)
- http_build_query: documentation ( source)
<?php
$params = array_merge($params, [
'response_type' => 'code',
'client_id' => 'client_id',
'redirect_uri' => 'redirectUri',
'scope' => [],
'access_type' => 'offline'
]);
echo 'https://accounts.google.com/o/oauth2/auth'.$paramString = http_build_query($params, null, '&');