Skip to content

Instantly share code, notes, and snippets.

@bbody
Created November 2, 2012 11:41
Show Gist options
  • Save bbody/4000595 to your computer and use it in GitHub Desktop.
Save bbody/4000595 to your computer and use it in GitHub Desktop.
Email Address Munger
<html>
<head>
<title>Email Address Munger</title>
</head>
<body>
<h3>Put your email in below</h3>
<form method='POST'>
<input type=text name='email'>
<input type=submit>
</form>
<?PHP
$email = $_POST['email'];
if (isset($_POST['email'])){
$text = $email;
$text = str_replace("@", " [at] ", $text);
$text = str_replace(".", " [dot] ", $text);
$text = str_replace("_", " [underscore] ", $text);
if (strlen($text) > 0){
print ("Your email <b>$email</b> has been
turned into <b>$text</b>\n");
}
}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment