Date: 08/28/01
- Next message: George Schlossnagle: "Re: [PHP-DEV] contributing extensions?"
- Previous message: George Schlossnagle: "Re: [PHP-DEV] contributing extensions?"
- In reply to: Jo Giraerts: "Re: [PHP-DEV] python dictionary-like % (percent) substitution in php (was: Good idea in % (percent) substitutions in string)"
- Next in thread: Jo Giraerts: "Re: [PHP-DEV] python dictionary-like % (percent) substitution in php (was: Good idea in % (percent) substitutions in string)"
- Reply: Jo Giraerts: "Re: [PHP-DEV] python dictionary-like % (percent) substitution in php (was: Good idea in % (percent) substitutions in string)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: George Schlossnagle: "Re: [PHP-DEV] contributing extensions?"
- Previous message: George Schlossnagle: "Re: [PHP-DEV] contributing extensions?"
- In reply to: Jo Giraerts: "Re: [PHP-DEV] python dictionary-like % (percent) substitution in php (was: Good idea in % (percent) substitutions in string)"
- Next in thread: Jo Giraerts: "Re: [PHP-DEV] python dictionary-like % (percent) substitution in php (was: Good idea in % (percent) substitutions in string)"
- Reply: Jo Giraerts: "Re: [PHP-DEV] python dictionary-like % (percent) substitution in php (was: Good idea in % (percent) substitutions in string)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

