No, ...
Actually,...
I want it so generic,
like myfile.txt can have like:
-
Welcome $username
Enjoy your staying at: $site_name
Mail admin. at $admin_mail for any questions...
-
so bascially, i don't want to do str_replace or else i could have used the
sprintf() and with '%s' instead of str_replace...

i even tried the eval() which should work, but it didn't, scroll down to
message with Subject: $hello

-elias

"Jason Stechschulte" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Thu, May 03, 2001 at 10:12:55AM -0700, elias wrote:
> > hello.
> > i read from a text file a line like: "Key=$value"
> > so, i do like:
> > $lines = join('', file("myfile.txt"));
> > echo $lines;
> > // output= Key=$value
> > Now how can i replace the values in the $lines variables?
> > i want like:
> > $value = "test";
> > echo $lines;
> > and i want ouput like: Key=test
> > any idea?
>
> May not be the best way, but it works:
> <?php
> $lines = join('', file("myfile.txt"));
> $value = "test";
> $lines = str_replace("\$value", $value, $lines);
> echo $lines;
> ?>
>
> --
> Jason Stechschulte
> [EMAIL PROTECTED]
> --
> Well, enough clowning around.  Perl is, in intent, a cleaned up and
> summarized version of that wonderful semi-natural language known as
> "Unix".
>              -- Larry Wall in <[EMAIL PROTECTED]>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to