4 ms·
Ummm, all of them? The basic problem you run into is that PHP is basically a templating language at its heart. If you don't immediately open with a "<?" you st
by sirclueless 15y ago
Ummm, all of them?
The basic problem you run into is that PHP is basically a templating language at its heart. If you don't immediately open with a "<?" you start sending data. If you want to use PHP as it was originally intended -- as raw HTML with a smattering of dynamic bits in the middle -- without losing the ability to set headers, then ob_start makes sense. If on the other hand you want to use it in the way that most people do, you open with "<?php" and proceed to abuse a whole bunch of bastardized perl templating functions followed by an "echo $data; ?>" at the end of your source code.
Now, given that PHP as a templating language is basically terrible, it's not that far out to just say, "To hell with PHP's native templating features, we're going to use our own!" but at that point you are already pretty far gone.
- badger7 15y ago> If you want to use PHP as it was originally intended... If you want to use teflon as it was originally intended, you should coat spacecraft with it. Whenever I want to fry sausages, I dismiss the original intention as irrelevent. You'd have me donate all my saucepans to NASA every time I got peckish, but what about my sausages? They're not going to cook themselves ya know :)