At 16:35 28-08-01, Jo Giraerts wrote:
>This is already possible in php, though with the following simple
>function..
>
> // function to read a file with php-vars in as a string
> // $predefined_vars: an array ("varname" => "value"). all the
> // variablenames defined in this array can be used in the bodyfile.
> // They will receive the respective values. This makes personalising
> // the mailes easier..
> function file_as_body($filename, $predefined_vars)
> {
> $ar = file($filename);
> extract($predefined_vars);
>
> foreach ($ar as $number => $line)
> {
> eval("\$ar2[] = \"$line\";");
Yikes, is there any reason that's not simply $ar2[] = $line;?
Anyway, how does it give the same functionality as the suggest aprintf()?
Zeev
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]