Re: Function as Parameter...
| From: | Juri Smarschevski | Date: | Wed, 09 Aug 2000 12:24:27 +0000 |
| Subject: | Re: Function as Parameter... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10908@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Martin [mailto:martin@thomatechnik.de]
> Sent: Wednesday, August 09, 2000 2:09 PM
>
> Hello !
Hi Martin,
> Is there anyway to give a (pointer to a) function to another
> function ?
>
> I want something like:
>
> function callExtraFunction($funktion)
> { # Here, the "$funktion" should be called;
> }
>
> function MyFunc1()
> { print "1";
> }
>
> function MyFunc2()
> { print "2";
> }
>
> So when I call callExtraFunction(MyFunc1); the output should be 1. Any
> adeas ?
function callExtraFunction($funktion)
{ # Here, the "$funktion" should be called;
eval ($funktion);
}
have a look to:
http://www.php.net/manual/function.eval.php
Regards,
Juri