Access to preprocess variables in a custom block I have created a custom block to display some contact information.

I have a preprocess function that sets a contact variable like so:

function atstump_preprocess(&amp;$vars, $hook) {
    $vars['contact'] = array(
        'name' =&gt; 'Doug Gillum',
        'business' =&gt; 'Portland Stump Grinding',
        /...
    );
}


I enabled the PHP filter, and set this as the text:

&lt;ul&gt;
  &lt;li&gt;&lt;?php print $contact['name']; ?&gt;&lt;/li&gt;
  &lt;li&gt;&lt;?php print $contact['phone']; ?&gt;&lt;/li&gt;
  &lt;li&gt;&lt;?php print $contact['email']; ?&gt;&lt;/li&gt;
&lt;/ul&gt;


However it doesn't recognize $contact as a proper variable and generates the PHP error E_NOTICE:

Notice: Undefined variable: contact in eval() (line 2 of C:\xampp\htdocs\stumpgrinding\modules\php\php.module(75) : eval()'d code).
Notice: Undefined variable: contact in eval() (line 3 of C:\xampp\htdocs\stumpgrinding\modules\php\php.module(75) : eval()'d code).
Notice: Undefined variable: contact in eval() (line 4 of C:\xampp\htdocs\stumpgrinding\modules\php\php.module(75) : eval()'d code).


Is it even possible to access the preprocess variables in a PHP filter? if not, is there a better way than hard coding them? maybe variable_set and variable_get and how would I set that up via the theme, I'd rather not make a module for this.
It won't work.
If you use a preprocess function, the variables will be available in the template of the block.

I think that, in your case, you should edit the settings.php file and add the following line:

$GLOBALS['email1'] = 'example@email.com';


You'll be able to use the variable $email1 through the whole site.

Have in mind that it's not a good Drupal practice.