Sometimes it is best to shorten our coding by making our own functions that we can use more than once but only require only one line the second time.
Here are the sources used in this tutorial:
tut021.php
<?php //PHP Tutorial 021 function happyturtles($turtles){ global $google; $turtles = (int)$turtles; $turtles = $turtles*2; echo rand(0,200)." "; return $turtles." "; } $google = 1; echo happyturtles(30); echo happyturtles(31); echo happyturtles(32); echo happyturtles(33); ?>