Thanks Michael & Marek! It worked! :)
"Michael Sims" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> >> OrangeHairedBoy wrote:
> >>> I would like to use eval() to evaluate another PHP file and store
> >>> the output of that file in a string.
> >>
> >> You could use output buffering
>> OrangeHairedBoy wrote:
>>> I would like to use eval() to evaluate another PHP file and store
>>> the output of that file in a string.
>>
>> You could use output buffering to do this a bit more easily, I think:
>>
>> ob_start();
>> include('colors.php');
>> $colors = ob_get_contents();
>> ob_end_
Marek,
OK...that worked...kinda, but it doesn't pass the output to $colors. It
echos it. I need the output to be passed to $colors.
Lewis
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> OrangeHairedBoy wrote:
> > I would like to use eval() to evaluate another PHP
OrangeHairedBoy wrote:
I would like to use eval() to evaluate another PHP file and store the output
of that file in a string.
So, let's say, for example, that I have a file called colors.php which
contains this:
Colors:
Then, in another file, I have this:
$file = file_get_contents( "colors.php"
While that is an awesome idea, I don't think it will work for me.
There's two reasons why. First, colors.php is actually stored in a MySQL
server.
Second, before the PHP code inside colors.php I want to be able to replace
data inside that file. For example:
$file = str_replace( "Green" , "Orange
OrangeHairedBoy wrote:
> I would like to use eval() to evaluate another PHP file and store the
> output of that file in a string.
You could use output buffering to do this a bit more easily, I think:
ob_start();
include('colors.php');
$colors = ob_get_contents();
ob_end_clean();
--
PHP General
I would like to use eval() to evaluate another PHP file and store the output
of that file in a string.
So, let's say, for example, that I have a file called colors.php which
contains this:
Colors:
Then, in another file, I have this:
$file = file_get_contents( "colors.php" );
$colors = eval( $f
7 matches
Mail list logo