Recursive Interpolation
| From: | Chuck Wolber | Date: | Tue, 05 Oct 2004 00:24:11 +0000 |
| Subject: | Recursive Interpolation | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-198629@lists.php.net to get a copy of this message | ||
Greetings,
I've seen a few posts from the middle of last year discussing the problem
of recursive interpolation:
http://marc.theaimsgroup.com/?l=php-general&m=105543152906744&w=2
http://marc.theaimsgroup.com/?l=php-general&m=105542523331255&w=2
It seems there's a HEREDOC method of hacking through this problem. In the
meantime, is there any other way?
Here's a description of a problem I'm having and how it would be nice to
see it solved:
Database *FIELD* with text data in it. The text data contains sentences
interspersed with $foo['bar'] array variables. The idea is that when one
selects this field, PHP will interpolate $foo['bar'] with the currently
defined $foo array variable. This allows for "form letter" like dispatches
to be created.
Given a variable $text that contains data retrieved with array variables,
It'd be useful to see something: $text_i = interpolate($text) which
recursively interpolates based on variables in the current namespace.
Granted, this opens up a *WHOLE* mountain of problems (circular references
anyone?). Is there any traction on an idea like this? Any other solutions
that aren't so hackish as HEREDOCs?
Thanks,
-Chuck
--
http://www.quantumlinux.com
Quantum Linux Laboratories, LLC.
ACCELERATING Business with Open Technology
"The measure of the restoration lies in the extent to which we apply
social values more noble than mere monetary profit." - FDR