Posted by Kimmo Laine on 02/21/07 07:34
"Richard" <rgrdev@gmail.com> wrote in message
news:878xesv6lx.fsf@gmail.com...
>
> Is it possible to store the address or reference to a function in php?
> Maybe
> using just a string and later dereferencing it?
>
> e.g some ideas to illustrate what I mean
>
> <?php
> function myCompanyMotto(){
> echo "hello";
> }
>
> $myarr["func1"]=&myCompanyMotto;
> $myarr["func2"]="myCompanyMotto";
>
> //how to get function from myarr and call it????
>
function foo(){
echo "Hello Kitty!";
}
$bar = 'foo';
$bar();
--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti pδivittyvδ nettisarjis
spam@outolempi.net | rot13(xvzzb@bhgbyrzcv.arg)
Navigation:
[Reply to this message]
|