On Monday 04 October 2004 16:43, Matthew Sims wrote:
> > Don't get too excited; this is an awfully lame newbie question.
>
> Too late, I'm already excited.

Sorry 'bout that.

> > <?php
> >  function square($num)
> >  {
> >     return $num * $num;
> >  }
> >  echo square(4);  // outputs '16'.
> >  ?>
> >
> > <br>
> > </body>
> > </html>
> >


> function square($num) {
>
>   $result = $num * $num;
>   return $result;
>
> }

Well, under the category of "That's weird", I changed the function to:

<?php
 function square($nn)
 {
$res = $nn * $nn;
return $res;
 }

and it works now. Mebbe there's goofy hidden chars in the online help?

Back to the drawing board.

Thanks!

-- 
Whil

Moving to Linux: Freedom, Choice, Security, Opportunity
http://www.hentzenwerke.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to