On Thu, May 03, 2001 at 03:56:55PM -0700, elias wrote:
> 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

I don't think you understand eval().  Either that or I don't.  If I
understand correctly, eval(); requires a complete PHP statement.  
Welcome $username is not a complete PHP statement.

Why don't you just make myfile.txt a valid php file and then include it?

myfile.txt.php:

Welcome <?php echo $username;?>
Enjoy your staying at: <?php echo $site_name;?>
Mail admin. at <?php echo $admin_mail?> for any questions...

index.php:
<?php
$username="eddie";
$site_name="stripmall";
$admin_mail="[EMAIL PROTECTED]";
include("myfile.txt.php");
?>

I'm not sure if this is what you want, but it will send this to the
browser:

Welcome eddie
Enjoy your staying at stripmall
Mail admin. at [EMAIL PROTECTED]

-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
Think of prototypes as a funny markup language--the interpretation is
left up to the rendering engine.
             -- 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]

Reply via email to