I found the possible problem and a solution.
I was putting the function below the function call. This is
how it worked with Perl and I was trying to do it the same
way. I couldn't figure out how to put this function earlier
in the script so I put the code I wanted to re-use in a separate
script and called it with include. This worked very well.
I'm tackling a sheet music database for my wife which might
be a little over my head as a newbie but I'm learning a lot
from it.
Jeff Oien
> I'm not getting any errors but the function display isn't
> doing anything. Thanks.
> Jeff Oien
>
> > <?php
> >
> > function someFunction($var)
> > {
> > echo $var;
> > }
> >
> > // Your script
> >
> > someFunction("Foobar!");
> > ?>
> >
> > if you're creating an instance of a class object....
> >
> > <?php
> > class someClass
> > {
> > function someFunction($var)
> > {
> > echo $var;
> > }
> >
> > }
> >
> > $someClass = new someClass;
> >
> > $someClass->someFunction("Foobar!");
> >
> > ?>
> >
> > Cheers,
> > -Jonathan Sharp
> >
> > > -----Original Message-----
> > > From: Jeff Oien [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 15, 2001 8:01 PM
> > > To: PHP
> > > Subject: [PHP] Newbie User Def Function Question
> > >
> > >
> > > Could anyone give me the correct syntax for calling a function.
> > >
> > > I have a block of code I want to reuse. How do I name this
> > > code block and how do I call it? Having a hard time finding an
> > > answer looking through docs. It's so basic I can't find
> > > an explanation. :)
> > > Jeff Oien
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]