1<?php
2 $apiKey = '<paste your API key here>';
3 $url = 'https://www.googleapis.com/language/translate/v2/languages?key=' . $apiKey;
4
5 $handle = curl_init($url);
6 curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); //We want the result to be saved into variable, not printed out
7 $response = curl_exec($handle);
8 curl_close($handle);
9
10 print_r(json_decode($response, true));
11?>