Re: Expand/parse variables in file

From: Date: Tue, 26 Jun 2001 03:38:43 +0000
Subject: Re: Expand/parse variables in file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-55179@lists.php.net to get a copy of this message
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" rather than "abc whatever def". Where's the difference to > directly doing the following: > > $a = "whatever"; > $b = "abc $a def"; > echo $b; > > which results in "abc whatever def" ??? > > What am I missing? > > Thanks in advance. [eval()] Or you could include/require the text file making sure the stuff you want interpreted in the file is enclosed in php tags - depends on exactly how your text is structured. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA A mind is a terrible thing to ... er ... hmmmm?

« previous php.general (#55179) next »