note 52697 added to function.ob-start

From: Date: Tue, 10 May 2005 09:10:44 +0000
Subject: note 52697 added to function.ob-start
Groups: php.notes 
Request: Send a blank email to php-notes+get-89198@lists.php.net to get a copy of this message
If you're trying to include a php file inside a loop by require_once (in example, a dinamic email template) and change the value of some variables (in example, url to unsuscribe, different for each user), you should use <?php // ... some code $usermail = array("email1", "email2", ...); for($i = 0; $i < $MAX; $i++) { $usermail_unsuscribe = $usermail[$i]; ob_start(); include("email_template.php"); ob_clean(); } ?> Otherwise $usermail_unsuscribe will get only "email1" value. ---- Manual Page -- http://www.php.net/manual/en/function.ob-start.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+52697 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52697&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52697&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52697&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52697&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52697&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+52697&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#89198) next »