Skip to content

Instantly share code, notes, and snippets.

View peterfox's full-sized avatar
🏠

Peter Fox peterfox

🏠
View GitHub Profile
@peterfox
peterfox / mailto_url_encode.php
Last active December 18, 2015 09:49
url encoding a mail to link in PHP
<?php
$URL = "mailto:?subject=Is this a test message!";
$url_var = $URL;
//explode it and if it has a '?' it means it must have URL Parameters
if(count($mail_split = explode('?', $URL))>1)
{
//if for some reason there's more than one '?' then we'll just add the exploded parts to the second part
$mail_params = $mail_split[1];
for($i=2; $i<count($mail_split); $i++)