Re: [PHP] Function calls and strings

2003-09-14 Thread Curt Zirzow
* Thus wrote Ney André de Mello Zunino ([EMAIL PROTECTED]):

> I seek to find out whether PHP also has a syntax to allow function calls 
> within a string, so that explicit concatenation is not needed. E.g.:
> 
> something like:
> 
>   $s = "The result is {getResult($foo)}.";
> 
> as opposed to
> 
>   $s = "The result is " . getResult($foo) . ".";
> 
> If that is not possible, I would appreciate if someone could suggest the 
> rationale.

How do I tell it NOT to call the function, i want to just store
this in a string:

$s = "The result is {getResult(\$foo)}.";
echo $s;

---
The result is {getResult($foo)).
---


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Function calls and strings

2003-09-11 Thread Ney André de Mello Zunino
Hello.

PHP possesses what the manual calls "complex syntax" for allowing one to 
include non-trivial expressions in strings, e.g.:

  $s = "The result is {$results[$foo]}.";

I seek to find out whether PHP also has a syntax to allow function calls 
within a string, so that explicit concatenation is not needed. E.g.:

something like:

  $s = "The result is {getResult($foo)}.";

as opposed to

  $s = "The result is " . getResult($foo) . ".";

If that is not possible, I would appreciate if someone could suggest the 
rationale.

Thank you,

--
Ney André de Mello Zunino
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php