dan wrote:
[color=blue]
> Hi,
>
> I am trying to see if this is possible. I have thought about it and
> cant see an easy way to do this.
>
>
> OK say I have a script
>
> <?php
>
> //these variables get set in the script
>
> $fname='Moe';
> $bday='1970';
>
> //extract a field from mysql
> //select someField from someTable limit 1;
> //the variable someField contains this value
>
> //$someField='Welcome back $fname ! wow you must be an old fart since
> you were born in $bday'
>
> As you can see the variable is stored in the mysql table with embedded
> variables in the string itself. What I would like to do is have these
> variables evaluated somehow so that the $someField value contains this
> value
>
> Welcome back Moe ! wow you must be an old fart since you were born in
> 1970
>
>
> ?>[/color]
Look at the eval() function:
http://us4.php.net/manual/en/function.eval.php
Basically, you'll want to use that on the field's value so that it will
fill in the correct variables.
--
Justin Koivisto -
spam@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.