Guys!

Your solutions are great, and i though of that too! but what prevents what
i'm thinking of to be done?

Again, ...i have a .TXT file and not a PHP file
and inside that .TXT file i have PHP variable names, like $myname, $hisemail
....
I want like:
$myname = "elias";
$hisemail = "[EMAIL PROTECTED]"
// Read myfile.TXT into $lines,
$parsed_lines = $lines; // Sure hoping it get parsed and $myname and other
vars get substituted
.
.
.
// store $parsed_lines into database

Actually, i don't want to Include("myfile.txt") i want to read it via file()
and find a solution to parse the nested variable names in it!

I even tried:

eval("\$parsed_lines = \"$lines\";"); // -> will be evaluated as:
$parsed_lines = "hello $myname, $hisemail"; , in turn should get correct
values of $myname and $hisemail and replace them into $parsed_lines ...

anyway...thanks all.

elias.

"Geir Eivind Mork" <[EMAIL PROTECTED]> wrote in message
01050411160600.03561@maria">news:01050411160600.03561@maria...
> On Thursday 03 May 2001 17:30, Jason Stechschulte wrote:
> >  On Thu, May 03, 2001 at 03:56:55PM -0700, elias wrote:
>
> >  > 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.
>
> that is correct, eval("echo $string"); can be used as a extremly silly way
to
> echo though.
>
> >  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...
>
> Now this is as effective as to go to another room for each sip of a glass
you
> make, why not just:
> <?
> echo <<<OUT
> Welcome $username<br>
> Enjoy your staying at: $site_name<br>
> Mail admin at $admin_mail for any questions
> OUT;
> ?>
> or at least use <?=$var?> if you want to be mean to the server instead of
> wearing out the keyboard.
>
> --
>  php developer / CoreTrek AS        | Higgledy Piggledy  Coeducational
Yale
>  Sandnes / Rogaland / Norway        | University   Extracurricular Gave up
>  web: http://www.moijk.net/         | misogyny  Heterosexual Opened its
door.
>
> --
> 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