Get your own PHP server Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<?php
function exclaim($str) {
  return $str . "! ";
}
function ask($str) {
  return $str . "? ";
}
function printFormatted($str, $format) {
  // Calling the $format callback function
  echo $format($str);
}
// Pass "exclaim" and "ask" as callback functions to printFormatted()
printFormatted("Hello world", "exclaim");
printFormatted("Hello world", "ask");
?>
</body>
</html>
Hello world! Hello world?