Thanks for your answer.
So, this is how my code actually look like:
my_php_file.php :
<?php $var="Hello world"; $smarty->assign("var", $var); ?>
ps_customtext.tpl :
[...] <p>{$var}</p> [...]
But still it doesn't work: the value of $var doesn't appear once I load the page, while all other contents of ps_customtext.tpl do appear.
What am I missing? Maybe I have to add some additionnal code into my PHP file to tell it to use Smarty?
I don't understand how an annonymous PHP file that is stored somewhere between PS files can generate the $var variable through Smarty if it's not even executed?