How do you pass that string?
If you replace via other file, you do not need to use strings, just call the function.
If you are parsing a variable, you do not need the inline ...
$_GET['function']("a", "b", "aaa");
if the query string is &function=str_replace
I do not get the problem at all specially now that you do not need variables ... and if you will end up with eval, you are doing something wrong.
Date: Sat, 28 Mar 2009 17:09:15 +0300
Subject: Re: [PHP] Calling function on the same line?
Thank you for trying to help, But I am trying to do it without variables.... =[
On Sat, Mar 28, 2009 at 3:51 PM, Andrea Giammarchi wrote:
I miss the utility to do stuff like that ... seriously ... but in any case:
echo ($f = 'str_replace') ? $f("a", "b", "aaa") : null;
where echo is optional.
Date: Sat, 28 Mar 2009 15:26:18 +0300
Subject: [PHP] Calling function on the same line? >
Is there any way to do something like: >
("str_replace")("a", "b", "aaa");
One of the problems that I must keep "str_replace" on the same line...The
only solution I see is call_user_func, but I would like to know if you guys
might have a clue =]
Tried looking on the manual, sadly didn't found anything >
More than messages–check out the rest of the Windows Live™.http://www.microsoft.com/windows/windowslive/
News, entertainment and everything you care about at Live.com. Get it now!http://www.live.com/getstarted.aspx