Re: Newbie question about <?= ?>
| From: | Al | Date: | Sun, 10 Sep 2006 15:52:54 +0000 |
| Subject: | Re: Newbie question about <?= ?> | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241561@lists.php.net to get a copy of this message | ||
Mike Borrelli wrote:
Good day, While I've been using php for more than a little while now, I've never understood why the use of the "<?= ...?>" short tag is noted "to be avoided". Or rather, I understand that there's an option to disable it, and that's why it's noted in this way, but I don't understand why it's disabled? What's gained by writing <?php echo some_function(); ?> over <?= some_function(); ?> Thanks in advance. Cheers, Mike Structurally, there is a far better way to compile your html pages. This approach is easier to design and debug and it is faster since it sends one complete packet instead of one for every short tag. And, it saves using ob_start() and ob_flush().Consider: $report= ''; $report .= function() [or whatever] ..... repeat as necessary to assemble your complete page. Then simply echo $report;