Convert PHP code below to JAVASCRIPT $long_url = urlencode('yourdestinationlink.com'); $api_token = ' XXXXXXXXXX'; $api_url = "https://google.com/api?api= {$api_token} &url= {$long_url} "; $result =...


Convert PHP code below to JAVASCRIPT



$long_url = urlencode('yourdestinationlink.com');
$api_token = '34233242323';
$api_url = "https://google.com/api?api={$api_token}&url={$long_url}";
$result = @json_decode(file_get_contents($api_url),TRUE);
if($result["status"] === 'error') {
 echo $result["message"];
} else {
 echo $result["shortenedUrl"];
}



Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here