Using goo.gl url shortener [Help modifying shortener for bit.ly]

Hi, so as some of you will know i have a file upload site that outputs bit.ly links.

$contents = file_get_contents("http://api.bit.ly/v3/shorten?login=andre1990&apiKey=R_56a95c84d089129012516e24806c3649&longUrl=".urlencode($final)."&format=txt");

echoing it out as:

<input type=“text” size=“10” onClick=select() value=“<?php echo $contents;?>” READONLY><p />

Now i want to use goo.gl instead now, any help? Ive got an api key.

Any help at all?

I think goo.gl uses curl command, but i wanted to just adapt my current code rather than start again.

This may be a silly question, but have you read through the documentation about the url shortener? It details everything that you will have to do (and how to do it) and provides code samples for using with PHP (and lots of other languages).

Not a silly question…i have had a look through and wasn’t able to decipher what a single piece of code would look like that would get the job done.