RE: [PHP] Newbie User Def Function Question
| From: | Jonathan Sharp | Date: | Fri, 16 Feb 2001 04:11:50 +0000 |
| Subject: | RE: [PHP] Newbie User Def Function Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-40097@lists.php.net to get a copy of this message | ||
<?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:jeff@webdesigns1.com]
> 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: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>