- array_merge: documentation ( source)
- http_build_query: documentation ( source)
<?php
$params = array_merge($params, [
'approval_prompt' => 'force',
'response_type' => 'code',
'client_id' => '377121273700-ee1mrkdknfarq5k74pc7qs2g6upqos05.apps.googleusercontent.com',
'redirect_uri' => 'http://adwords.site/token',
'scope' => 'https://www.googleapis.com/auth/adwords',
'access_type' => 'offline'
]);
echo 'https://accounts.google.com/o/oauth2/auth'.$paramString = http_build_query($params, null, '&');