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 you

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()

2001-01-10 Thread Maxim Maletsky
your question well? Cheers, Maxim Maletsky -Original Message- From: Kristofer Widholm [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 11, 2001 3:20 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re-engineering print() Here's what you wrote, 01-01-11: > > $s = sprintf("

Re: [PHP] Re-engineering print()

2001-01-10 Thread Josh G
D]> To: "Kristofer 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 redire

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 ca

Re: [PHP] Re-engineering print()

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

Re: [PHP] Re-engineering print()

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

Re: [PHP] Re-engineering print()

2001-01-10 Thread Toby Butzon
riable. --Toby - 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(&q

Re: [PHP] Re-engineering print()

2001-01-10 Thread Kristofer Widholm
Here's what you wrote, 01-01-11: > > $s = sprintf("%s", implode("\n", file('template.php'))); > >Why this??? It's redundant, isn't it? Wouldn't > >$s= implode("\n", file('template.php')); do it? > >Gfunk Gfunk, and Mr. Murray, I guess I didn't write my query very clearly. What I am looking for

Re: [PHP] Re-engineering print()

2001-01-10 Thread Josh G
> $s = sprintf("%s", implode("\n", file('template.php'))); Why this??? It's redundant, isn't it? Wouldn't $s= implode("\n", file('template.php')); do it? Gfunk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

RE: [PHP] Re-engineering print()

2001-01-10 Thread Jason Murray
> #Option 1: code I wish worked > $s = include("phpcode.php"); > > #Option 2: also code I wish worked > $s = sprintf("%s", include('template.php')); $s = sprintf("%s", implode("\n", file('template.php'))); :) Jason -- Jason Murray [EMAIL PROTECTED] Web Design Team, Melbourne IT Fetch the com

[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", include('template.php'

[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", include('template.php'