I have something like this in PHP
$file = "$dir/" . basename($url);
basename is a built-in function. Is there a way I can use string interpolation syntax for concatenation instead of . syntax?
For member functions of a class, this works:
$file = "$dir/ {$this->someFunc($url)}";
How do I similarly specify internal functions in quoted strings? Just learning.
"{$x->y()}"works. Thanks.class functionCaller { public static function caller($function, ...$args) { return call_user_func_array($function, $args); } } $fc = new functionCaller(); $file = "$dir/{$fc->caller('basename',$url)}"