I miss the utility to do stuff like that ... seriously ... but in any case:

<?php
echo ($f = 'str_replace') ? $f("a", "b", "aaa") : null;
?>

where echo is optional.

Regards


> Date: Sat, 28 Mar 2009 15:26:18 +0300
> From: danondan...@gmail.com
> To: php-general@lists.php.net
> Subject: [PHP] Calling function on the same line?
> 
> Is there any way to do something like:
> 
> <?php
> ("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
> 
> Thanks, Daniel

_________________________________________________________________
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/

Reply via email to