Hi, I'm involved in a conundrum that is a little difficult to explain
with plain English. Perhaps some PHP code will help you understand
what I am attempting:
#Option 1: code I wish worked
$s = include("phpcode.php");
#Option 2: also code I wish worked
$s = sprintf("%s",
Hi, I'm involved in a conundrum that is a little difficult to explain
with plain English. Perhaps some PHP code will help you understand
what I am attempting:
#Option 1: code I wish worked
$s = include("phpcode.php");
#Option 2: also code I wish worked
$s = sprintf("%s",
- Original Message -
From: "Kristofer Widholm" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 11, 2001 1:19 AM
Subject: Re: [PHP] Re-engineering print()
Here's what you wrote, 01-01-11:
$s = sprintf("%s", implode("\n",
file('template.php')));
rt to eval()...
Gfunk
My name was Brian McGee,
I stayed up listening to Queen,
When I was seventeen.
http://www.gfunk007.com/
- Original Message -
From: "Kristofer Widholm" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 11, 2001 5:19 PM
S
-
From: "Kristofer Widholm" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 11, 2001 5:19 PM
Subject: Re: [PHP] Re-engineering print()
Here's what you wrote, 01-01-11:
$s = sprintf("%s", implode("\n", file('template.php')));
Why
On Wed, 10 Jan 2001, Kristofer Widholm wrote:
Basically, I'm wondering if there is a way to redirect print and echo
output from PHP to a variable instead of directly to a browser or
file stream. What I'm trying to do is create code that can generate
an HTML page to a variable that I can
istofer Widholm" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, January 11, 2001 5:37 PM
Subject: Re: [PHP] Re-engineering print()
On Wed, 10 Jan 2001, Kristofer Widholm wrote:
Basically, I'm wondering if there is a way to redirect print and echo
output from PHP to a variable
Try this:
function my_eval($code) {
ob_start();
eval($code);
$retval = ob_get_contents();
ob_end_clean();
return $retval;
}
$str = my_eval("echo 2+2;");
echo $str;
-Rasmus
On Thu, 11 Jan 2001, Kristofer Widholm wrote:
Here's what you wrote, 01-01-11:
$s = sprintf("%s",
Here's what you wrote, 01-01-10:
Try this:
function my_eval($code) {
ob_start();
eval($code);
$retval = ob_get_contents();
ob_end_clean();
return $retval;
}
$str = my_eval("echo 2+2;");
echo $str;
Mr. Lerdorf, Mr. McClahahan, Mr. Butzon et al,
Thank you for your replies.
9 matches
Mail list logo