How to combine two string in Smarty?-Collection of common programming errors

I have only used smarty a little but I think if you surround your concatenation with backticks then it will evaluate them properly. Example below:

{my_function(`$test.'a1'`)} 

There is also the assign built in function which may also be useful: http://www.smarty.net/docsv2/en/language.custom.functions.tpl#language.function.assign

Finally, if all else fails do the concat in php and assign it to a single variable and passing that to the template.

Edit, ignore the above suggestions, I think you should be using the following syntax:

{my_function var="`$test`a1"}

http://www.smarty.net/docsv2/en/language.syntax.quotes.tpl