get functions return

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dall
Forum Newbie
Posts: 5
Joined: Sun Feb 04, 2007 7:59 am

get functions return

Post by dall »

I'm writing template system, template system gets function name,
so I have to get function result in array to replace it.
how to do something like this?

Code: Select all

function function_result($function)
{
    $f = call_user_func($function);
    return $f;
}
I need to hold function result to use it letter.

Thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I don't understand. Please explain further.
dall
Forum Newbie
Posts: 5
Joined: Sun Feb 04, 2007 7:59 am

Post by dall »

ok.

in database table I have functions names like 'xx_xxx2', it is block
in template file I have [REQ_x], I need to replace [REQ_x] with functions, who are in 'x' region.

Only problem that I have, I don't know how to hold function return, to use it letter(cache, etc.).
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Your example posted above stores a function return into a variable. I don't see the mystery that you're finding.
Post Reply