note 74020 added to function.ob-start

From: Date: Wed, 21 Mar 2007 04:03:08 +0000
Subject: note 74020 added to function.ob-start
Groups: php.notes 
Request: Send a blank email to php-notes+get-124653@lists.php.net to get a copy of this message
Aleksey touched on this earlier, but here's a simple way to set the page title after you've generated the body content: <html><head><title> <?php function inserttitle($bufin) { global $title; $out = $title.$bufin; return $out; } ob_start('inserttitle'); // buffering the body print "<body><p>this is part of the body\n"; print "<p>another line\n"; // we have established the body before we set the title $title = "finally set title</title></head>\n"; // inserttitle is called when we flush ob_end_flush(); // and it has generated good html ?> </body> </html> ---- Server IP: 69.147.83.197 Probable Submitter: 206.222.222.42 ---- Manual Page -- http://www.php.net/manual/en/function.ob-start.php Edit -- https://master.php.net/note/edit/74020 Del: integrated -- https://master.php.net/note/delete/74020/integrated Del: useless -- https://master.php.net/note/delete/74020/useless Del: bad code -- https://master.php.net/note/delete/74020/bad+code Del: spam -- https://master.php.net/note/delete/74020/spam Del: non-english -- https://master.php.net/note/delete/74020/non-english Del: in docs -- https://master.php.net/note/delete/74020/in+docs Del: other reasons-- https://master.php.net/note/delete/74020 Reject -- https://master.php.net/note/reject/74020 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#124653) next »