How to generate short url using PHP and Google API
<html> <body> <form method=”post” action=””> <input type=”text” name=”url_val”> <input type=”submit” name=”submit_url”> </form> </body> </html> PHP Code <?php if(isset($_POST[‘submit_url’])) { $long_url=$_POST[‘url_val’]; $apiKey = ‘Your API Key’; $data = array(‘longUrl’ => $long_Url, ‘key’ => $apiKey); $jsonData = json_encode($data); $curlObj = curl_init(); curl_setopt($curlObj,…