I was replying to "If you don't do it this way, you'll find yourself re-writing a function sooner or later because you need it to return the data instead of displaying it."... Then you don't need to modify the function if you turn on ob, call function, then get contents, then clear ob... Ok, it's a rather bad way to do it, but it works for me... Problem comes if ob is already on though... The question is definitly a matter of situation... In a template system, all output should be returned... For an error function, maybe the error should be displayed... I use functions to add header and footer on some of my pages... Now, I guess that could be returned as well, but why type "echo mk_body()" when you could just type mk_body()..?
Now, where did those two paragraphs come from? A bit of experience with all those langs and the BASIC school... I'm at the age of 14 and don't even know math yet so (I mean, I know +, -, / and *, but not advanced stuff)... // DvDmanDT "Hugh Bothwell" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > "Dvdmandt" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Or you could just temporarily enable ob... That's what I do when I have a > > function that needs to return lots of HTML containing many ' and "... I > know > > it's possible to use \ as well, but ob is somewhat easier then... > > > You're missing the point. Output buffering can be useful, > but it is an entirely separate issue from the functional > programming style these two are endorsing > (and with which I wholeheartedly agree). > > Too many people learned programming in the > BASIC school, writing 'do this, then add this, then > append that and the other' programs and ending > up with five-page subroutines. > > A bit of experience with LISP or ML or FORTH > can be a wonderful thing; you start to see how > to simplify your problems, breaking them into > smaller and smaller pieces until all the answers > are obvious and there are no places left for bugs > to hide, passing the results back to build your > final solution and keeping the pieces generic > and reuseable. > > -- > Hugh Bothwell [EMAIL PROTECTED] Kingston ON Canada > v3.1 GCS/E/AT d- s+: a- C+++ L++>+++$ P+ E- W+++$ N++ K? w++ M PS+ > PE++ Y+ PGP+ t-- 5++ !X R+ tv b++++ DI+++ D-(++) G+ e(++) h-- r- y+ > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php