Function in views tpl How can I add a function  in my custom views .tpl page or where can I write my function and call that function in my views .tpl ?
You can write the function in any php file that gets loaded.  PHP is not sequential in loading/processing files, it will load them first then process.