Re: function
| From: | Dan Joseph | Date: | Fri, 04 May 2012 02:29:24 +0000 |
| Subject: | Re: function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-317770@lists.php.net to get a copy of this message | ||
On Thu, May 3, 2012 at 10:12 PM, Ron Piggott <ron.piggott@actsministries.org
> wrote:
> I need to access a FUNCTION I programmed within a different FUNCTION. Are
> these able to be passed like a variable? Or are they able to become like a
> $_SESSION variable in nature? How am I able to do this?
>
> I am essentially programming:
>
> ===
> function name( $flag1, $flag2 ) {
>
> # some PHP
>
> echo name_of_a_different_function( $flag1 , $flag2 );
>
> }
> ===
>
> The error I am receiving is “Call to undefined function
> name_of_a_different_function”
>
>
Are these inside classes or anything? If they're just functions, they
should work fine together, example of 2 working functions together:
<?php
hellotwo();
function helloone()
{
echo "hi 1";
}
function hellotwo()
{
helloone();
}
?>
This results in "hi 1" being echoed to the screen.
--
-Dan Joseph
http://www.danjoseph.me