I have defined a function to return an array and need to pass this array as a parameter to a template (node--contenttype.tpl.php).
function mymodule_preprocess_page(&$variables) {{
$variables['tdata'] = $myArray;
}
In node--contenttype.tpl.php
print $tdata;
I tried to call the variable $tdata, but the error shows
Notice: Undefined variable: tdata in include()...
The same error happens if I define a variable in template.php and call from node--contenttype.tpl.php.