Passing variable from preprocess block to the block body There is a block which its body is produced by PHP Code. I need to set a variable before loading the block and use it in it. This is my code

function THEME_preprocess_block(&amp;$variables){
    $variables['var']="some text";
}


when I open the block configuration page and in its body I write

&lt;?php print $var;?&gt;


it prints nothing. How do I can pass variable from block template page in to the block body in the block configuration page?
Your variable will be available in block.tpl.php. Consider making your own block like described on How to theme a custom block?. (You probably do not need hook_theme().)

Using PHP directly in blocks (via UI) is not the best practice: It slows your site down, as the block needs to be rendered with every request, when it comes to caching.