How can I access the node ID when writing PHP into a block? I see that when I am creating a block through the drupal admin I can use PHP, in addition to plain text &amp; html.  Is there a variable in scope that I can use to access the node id?

&lt;?php echo my_custom_function( $node_id, $my_desired_class); ?&gt;
You can use the menu_get_object() function which will get you the node object for the page, assuming of course your block is being displayed on a node page:

$node = menu_get_object();

if (isset($node-&gt;nid)) {
  $nid = $node-&gt;nid;
  echo my_custom_function($nid, $my_desired_class);
}