<?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]

Reply via email to