Re: [PHP] About printing functions

2009-01-22 Thread Jan G.B.
2009/1/21 Thodoris t...@kinetix.gr: ?php ob_start(); badFunctionThatSpitsInsteadOfReturning(); $sReturned = ob_get_contents(); ob_end_clean(); ? That's a good though thanks. Although I was aware of output buffering I used to ignore that ob_end_clean actually exists... You can

Re: [PHP] About printing functions

2009-01-22 Thread Török Alpár
2009/1/22 Jan G.B. ro0ot.w...@googlemail.com 2009/1/21 Thodoris t...@kinetix.gr: ?php ob_start(); badFunctionThatSpitsInsteadOfReturning(); $sReturned = ob_get_contents(); ob_end_clean(); ? That's a good though thanks. Although I was aware of output buffering I used

Re: [PHP] About printing functions

2009-01-22 Thread Jan G.B.
2009/1/22 Török Alpár torokal...@gmail.com: 2009/1/22 Jan G.B. ro0ot.w...@googlemail.com 2009/1/21 Thodoris t...@kinetix.gr: $sReturned = ob_get_contents(); ob_end_clean(); That's a good though thanks. Although I was aware of output buffering I used to ignore that ob_end_clean

[PHP] About printing functions

2009-01-21 Thread Thodoris
Hi gang, Lets say that you have a function that prints something to the output simply like this: function print_str() { print blah blah blah; } I was wondering if there is a way to use this output and store it in a var or something without changing the function itself? And store the

Re: [PHP] About printing functions

2009-01-21 Thread Jason Pruim
On Jan 21, 2009, at 1:33 PM, Thodoris wrote: Hi gang, Lets say that you have a function that prints something to the output simply like this: function print_str() { print blah blah blah; } I was wondering if there is a way to use this output and store it in a var or something

Re: [PHP] About printing functions

2009-01-21 Thread Edmund Hertle
2009/1/21 Jason Pruim japr...@raoset.com On Jan 21, 2009, at 1:33 PM, Thodoris wrote: Hi gang, Lets say that you have a function that prints something to the output simply like this: function print_str() { print blah blah blah; } I was wondering if there is a way to use this

Re: [PHP] About printing functions

2009-01-21 Thread Thodoris
On Jan 21, 2009, at 1:33 PM, Thodoris wrote: Hi gang, Lets say that you have a function that prints something to the output simply like this: function print_str() { print blah blah blah; } I was wondering if there is a way to use this output and store it in a var or something

Re: [PHP] About printing functions

2009-01-21 Thread Török Alpár
you can use Output Buffering : ?php ob_start(); badFunctionThatSpitsInsteadOfReturning(); $sReturned = ob_get_contents(); ob_end_clean(); ? 2009/1/21 Edmund Hertle edmund.her...@student.kit.edu 2009/1/21 Jason Pruim japr...@raoset.com On Jan 21, 2009, at 1:33 PM, Thodoris

Re: [PHP] About printing functions

2009-01-21 Thread Edmund Hertle
2009/1/21 Thodoris t...@kinetix.gr On Jan 21, 2009, at 1:33 PM, Thodoris wrote: Hi gang, Lets say that you have a function that prints something to the output simply like this: function print_str() { print blah blah blah; } I was wondering if there is a way to use this output

Re: [PHP] About printing functions

2009-01-21 Thread Thodoris
you can use Output Buffering : ?php ob_start(); badFunctionThatSpitsInsteadOfReturning(); $sReturned = ob_get_contents(); ob_end_clean(); ? That's a good though thanks. Although I was aware of output buffering I used to ignore that ob_end_clean actually exists... --

Re: [PHP] About printing functions

2009-01-21 Thread Paul M Foster
On Wed, Jan 21, 2009 at 08:49:46PM +0200, Thodoris wrote: snip Well Jason my point is theoretical. Lets just say that this function doesn't just print blah blah blah but like tones of html that you may like to reuse... Well you could always change it to this: function print_str() {

Re: [PHP] About printing functions

2009-01-21 Thread Török Alpár
2009/1/21 Edmund Hertle edmund.her...@student.kit.edu 2009/1/21 Thodoris t...@kinetix.gr On Jan 21, 2009, at 1:33 PM, Thodoris wrote: Hi gang, Lets say that you have a function that prints something to the output simply like this: function print_str() { print blah blah

Re: [PHP] About printing functions

2009-01-21 Thread Mattias Thorslund
Thodoris wrote: Hi gang, Lets say that you have a function that prints something to the output simply like this: function print_str() { print blah blah blah; } I was wondering if there is a way to use this output and store it in a var or something without changing the function itself?