I have a function the_search() that ju开发者_C百科st echoes what people searched for.
I want to put that in to another function, get_data($var) to get some data.
How can I set the_search(); equal to some $var so that I can do the following:
$thing = get_data('$var');
a) You could change the_search not to echo the data, but to return it.
b) You could use Output Buffering:
ob_start();
the_search();
$var = ob_get_clean();
加载中,请稍侯......
精彩评论