I have no idea how you're including the PHP file, what the variables look like, whether the PHP file itself contains HTML to render stuff.
It's all a bit too vague to answer with much detail.
That being said, typically your template hook would look like this (bare bones)
Rich (BB code):
public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
{
if ($hookName == 'message_user_info_avatar')
{
}
}
How you include your PHP file, and what you want to achieve, I have no idea. But if that PHP file contains an array of data called $stuff (for example) then you could pass that to the hook like this:
Rich (BB code):
$hookParams['stuff'] = $stuff;
You would now be able to use {$stuff} in your template.
You can verify the "stuff" has been passed to the template by dumping it using:
{xen:helper dump, $stuff}
This would output the raw data from the array in your template.
But again, this is all very vague as I'd probably need to see all of your code and work out what you're trying to achieve to be more accurate/specific. But hopefully what I've said so far will help.