Hi Everyone,

I am very new to PHP, and I need some help with a project I am working on. So basically what happens is the QR code is generated and a short URL is generated as well for the QR Code, and what I need is the short URL that is generated to be sent to my email address. Here is what the code looks like:
PHP Code:

class Url_shortner_class {
shorten_url($criteria=array()) {
$url $criteria['url'];
$type $criteria['type']; //google
if($type=='google') {
    Google shortner service
function shorten_url_with_google($criteria=array()) {
$url $criteria['url'];
$api_url 'https://www.googleapis.com/urlshortener/v1/url';
$GLOBALS['google_api_key']!=''$api_url .= '?key='.$GLOBALS['google_api_key'];
$result getDataFromUrl($api_urljson_encode(array("longUrl"=>$url)), 'json');
$result json_decode($result,true);
$data['longUrl'] = $url;
$data['shortUrl'] = $result['id'];

All I need is to add a section that will send the URL to my email address, but I am unsure on how to write the code to do that. Thank you!