Skip to content

Instantly share code, notes, and snippets.

@rlemon
Created June 5, 2013 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rlemon/6fbdf690982d888b6c04 to your computer and use it in GitHub Desktop.
Save rlemon/6fbdf690982d888b6c04 to your computer and use it in GitHub Desktop.
<?php
if( isset($_GET['age']) && is_numeric($_GET['age'])) {
$age = $_GET['age'];
$msg = $age . ' / 2 + 7 = ' . (floatval($age)/2+7);
} else {
$msg = "Y U NO PROVIDE AGE?!";
}
$im = imagecreate(400, 24);
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 5, 0, 0, $msg, $textcolor);
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment