$title /**/ function encoded_mailto($email, $title=NULL, $obfuscate=false) { // Pull off any query string if (preg_match('/^(.+?)(\?.*)$/', $email, $match)) { $email = $match[1]; $query = $match[2]; } else $query = ''; // Do some fun obfuscation to the email address if ($obfuscate) { $email = str_replace('.', ' (dot) ', str_replace('@', ' (at) ', $email) ); } // Add some extra magic # // Default title is the email address if (empty($title)) $title = $email; // hex-encode the mailto link return '' .'�'.rtrim(chunk_split(bin2hex($title), 2, ';�'), '�') .''; }