Re: [PHP] Expand/parse variables in file

2001-06-27 Thread Richard Lynch
$b = 'abc $a def'; $a = 'whatever'; Actually, what I think you'll end up with needing is more like: eval("$c = \"$b\""); You can't just eval($b) because that would be like typing: You need something roughly equivalent to: http://php.net/eval -- WARNING [EMAIL PROTECTED] address is an enda

Re: [PHP] Expand/parse variables in file

2001-06-26 Thread mailing_list
> $a = "whatever"; > $b = "abc $a def"; > echo $b; but: $a = 'whatever; $b = 'abc $a def'; echo $b; doesn't do what you like (and this is more likely your problem!) this is the clue: $a = 'whatever; $b = 'abc $a def'; echo eval($b); michi -- GMX - Die Kommunikationsplattform im Internet. http

Re: [PHP] Expand/parse variables in file

2001-06-26 Thread David Robley
On Mon, 25 Jun 2001 23:09, Gunther E. Biernat wrote: > All, > > This ought to be simple, but I can't crack it... > > I'm trying to read a plain text file where I embedded some variables. > E.g. > > abc $a def > > Sucking this file in a string and setting $a to "whatever" results in > "abc $a def"

Re: [PHP] Expand/parse variables in file

2001-06-26 Thread David Robley
On Mon, 25 Jun 2001 23:09, Gunther E. Biernat wrote: > All, > > This ought to be simple, but I can't crack it... > > I'm trying to read a plain text file where I embedded some variables. > E.g. > > abc $a def > > Sucking this file in a string and setting $a to "whatever" results in > "abc $a def"

RE: [PHP] Expand/parse variables in file

2001-06-26 Thread Jason Lustig
>$a = "whatever"; >$b = "abc $a def"; >echo $b; > >which results in "abc whatever def" ??? > >What am I missing? $b = "abc $a def"; That gets parsed because it's in double-quotes. Since $a is a variable, it inputs whatever $a is, in this case "Whatever". So it ends up printnig out "abc whatever

Re: [PHP] Expand/parse variables in file

2001-06-25 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("Gunther E. Biernat") wrote: > I'm trying to read a plain text file where I embedded some variables. E.g. > > abc $a def > > Sucking this file in a string and setting $a to "whatever" results in "abc $a > def" rather than "abc whatever def".

[PHP] Expand/parse variables in file

2001-06-25 Thread Gunther E. Biernat
All, This ought to be simple, but I can't crack it... I'm trying to read a plain text file where I embedded some variables. E.g. abc $a def Sucking this file in a string and setting $a to "whatever" results in "abc $a def" rather than "abc whatever def". Where's the difference to directly doi