try splitting it first to get several strings into one array, then loop
the array and replace its each element concatenating the strings. This
is how my mind can process it so far :)


--
Maxim Maletsky
[EMAIL PROTECTED]


www.PHPBeginner.com  // PHP for Beginners
www.maxim.cx         // my Home

// my Wish List:     ( Get me something! )
http://www.amazon.com/exec/obidos/registry/2IXE7SMI5EDI3



"Daniel Pupius" <[EMAIL PROTECTED]> wrote... :

> Hey there,
> 
> We have a class that sets up a tree structure that represents an e-learning
> object made up of nested "components".  We have a function
> getPropertyValue($name) which returns the property $name for the current
> component.
> 
> Now, we want to allow the user to use something like {parent.property} in a
> property value, so that it can inherit parts of properties from the parent
> component.  For example: caption = "the name of this component's parent is
> {parent.name}!"
> 
> The following line sort of works:
> $retVal =
> preg_replace("/(.*){parent.(.*)}(.*)/e","'\\1'.\$this->parentNode->getProper
> tyValue('\\2').'\\3'",$retVal);
> 
> However, if there are more than one string to replace it only works on the
> last one.  So:
> caption = "the parent's coordinates are ({parent.left}, {parent.top})" would
> only return something like:  "the parent's coordinates are ({parent.left},
> 100)"
> 
> Hope someone can help.
> 
> Thanks
> 
> Dan
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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

Reply via email to