View Category

Check your language appears on the site

Your language name should appear within the HTML found at the main page.
if (preg_match("/PHP/i", file_get_contents(""))) {
echo "PHP appears on";
} else {
echo "PHP doesn't appear on";

Send an email

Use library functions, classes or objects to create a short email addressed to your own email address. The subject should be, "Greetings from", and the user should be prompted for the message body, and whether to cancel or proceed with sending the email.
/* This is a version without any prompt – use it for a website */
$to = "mail@domain.tld";
$subject = "Greetings from";
$body = "Hi,\n\nHow are you?";
$headers = "From: sender@domain.tld\n"; // you can comment this out and delete it from below
if (mail($to, $subject, $body, $headers)) {
echo "Success";

* For some (security)reason I couldn't
* submit this without adding a space to
* the functionnames. Please remove it :)
* in this case, only "f write" and "f gets"

$to = "mail@domain.tld";
f write(STDOUT, "Mail: ".$to."\n");
$subject = "Greetings from";
f write(STDOUT, "Subject: ".$subject."\n");
f write(STDOUT, "Please type the body. Use \\n for newlines: \n");
$body = trim(f gets(STDIN)); // we get input
if ($body == "") { // if empty input
$body = "Hi! How are you?";
f write(STDOUT, "Using standard body: ".$body."\n");
f write(STDOUT, "Would you like to send the mail? [y/n]: ");
if (trim(f gets(STDIN)) == "y") {
if (mail($to, $subject, $body)) {
f write(STDOUT, "Success\n");
} else { // fallback
f write(STDOUT, "Failed to mail\n");
} else { // fallback
f write(STDOUT, "I'm sorry :(\n");