function problem
Posted: Wed Jan 26, 2005 9:37 am
ok... so i have this code
and the reply is
Code: Select all
<?php
$number = 5;
echo "the number is ".$number;
echo "<br>";
square($number);
echo "the number squared is ".$number;
function square($number)
{
$counter = $number;
$onumber = $number;
do
{
$number= $onumber*$onumber;
$counter--;
} while ($counter >=1);
return $number;
}
?>... the function doesn't seem to work and i'm not sure why... it's probly a very stupid mistake that i've made... would appreciate the help though... thanx...the number is 5the number squared is 5