Page 1 of 1

Problem about include some $str

Posted: Thu Dec 11, 2008 3:07 am
by justin.he
I have a variable like $str.
$str content is a php file Mixed some html. I want to include this $str to some php file.

Now I first make a file like aa.txt (content is $str) then include this file.But build a file is slowly and not the best way.

Anyother way to include this $str? (PS:the variable have some str like <?php echo $abc ?> so , you know...)

Re: Problem about include some $str

Posted: Thu Dec 11, 2008 4:58 am
by requinix
I will rot in hell for suggesting this, but you could use eval().

Code: Select all

eval("?>" . $str);
In an effort to save my soul, is there a chance you can change the system so that this code is stored in a file instead?

Re: Problem about include some $str

Posted: Thu Dec 11, 2008 10:52 pm
by justin.he
Thanks for you suggestion. I will try.