Whenever you need a php method, you may add it to the template.ini file :
[PHP]
# A list with php functions and their equivelant template operator names
# Giving the operators a different name from the PHP functions
# are recommended, that way you ensure that all operators follow
# the same naming guidelines. It also means that you can change the
# php function later on without doing template changes.
PHPOperatorList[]
PHPOperatorList[urlencode]=urlencode
However this only works with operators that handles one parameter max.
While Nabil is correct about the use of eZ publish's built in PHPOperatorList feature.
<i>http://ez.no/ezpublish/documentation/development/kernel/custom_template_operators
http://ez.no/ezpublish/documentation/development/extensions/template_operator http://ez.no/doc/ez_publish/technical_manual/3_8/reference/template_operators</i>
I find that feature horribly limited as it <i>only</i> works with PHP functions which accept <b>only one argument</b>, this greatly limits the PHP functions you can use.
I encourage you to use the wrapper operator contribution instead! <i>http://ez.no/community/contribs/template_plugins/wrapper_operator</i>
The wrapper operator allows for use of any PHP function regardless of number of arguments or parameters.