Re: [SMARTY] new plugin: mailto
| From: | Monte Ohrt | Date: | Wed, 22 May 2002 15:57:05 +0000 |
| Subject: | Re: [SMARTY] new plugin: mailto | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4357@lists.php.net to get a copy of this message | ||
Yeah, I was thinking !empty($mail_params) but is_array would work too, and probably more accurate anyway.
Robert Amos wrote:
since you're talking performance if (is_array($mail_params)) { $address .= '?' . implode('&', $mail_params); } saves php determining the count -bok On 23/5/02 1:43 AM, Monte Ohrt banged a keyboard and produced the following weird but readable email:-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.I like Kelly's suggestion: if(count($mail_parms)) { $address .= '?' . implode('&', $mail_parms); } Ivo Jansch wrote:Hi, Alan McFarlane wrote:for ($i = 0, $j = count($mail_params); $i < $j; $i++) { //... }Wouldn't this be even faster? foreach ($mail_params as $param) { } Maybe it's slower, maybe php is optimised to do this very fast.. In any case it looks cleaner. Greetings, Ivo