FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » pass arbitrary vars into a func from another func?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: pass arbitrary vars into a func from another func? [message #177523 is a reply to message #177518] Thu, 05 April 2012 20:14 Go to previous messageGo to previous message
J. Frank Parnell is currently offline  J. Frank Parnell
Messages: 12
Registered: January 2012
Karma:
Junior Member
Great! thanks :)

On Apr 4, 1:58 pm, Thomas Mlynarczyk <tho...@mlynarczyk-webdesign.de>
wrote:
> J. Frank Parnell schrieb:
>
>> function echoToVar($func,$args = array()){
>>                   ob_start();
>>               $func($args);
>>                    $ret= ob_get_contents();
>>                       ob_end_clean();
>>    return $ret;
>> }
>
>> but i'm not sure how to get the args into the variable func.
>
> You want <www.php.net/call-user-func-array>:
>
> function echoToVar( $func, array $args = array() )
> {
>      ob_start();
>      call_user_func_array( $func, $args );
>      $ret = ob_get_contents();
>      ob_end_clean();
>      return $ret;
>
> }
>
> Greetings,
> Thomas
>
> --
> Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
> (Coluche)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Lead an open source Project "Free Network and Office management system" in php or java
Next Topic: Lead an open source Project "Free Network and Office management system" in php or java.
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 14:41:53 GMT 2024

Total time taken to generate the page: 0.04934 seconds