[PHP] Re-engineering print()

2001-01-10 Thread Kristofer Widholm
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",

[PHP] Re-engineering print()

2001-01-10 Thread Kristofer Widholm
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",

Re: [PHP] Re-engineering print()

2001-01-10 Thread Toby Butzon
- 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')));

Re: [PHP] Re-engineering print()

2001-01-10 Thread Josh G
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

Re: [PHP] Re-engineering print()

2001-01-10 Thread Josh G
- 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

Re: [PHP] Re-engineering print()

2001-01-10 Thread Matt McClanahan
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

Re: [PHP] Re-engineering print()

2001-01-10 Thread Josh G
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

Re: [PHP] Re-engineering print()

2001-01-10 Thread Rasmus Lerdorf
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",

Re: [PHP] Re-engineering print() - PHP 4 required

2001-01-10 Thread Kristofer Widholm
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.