Print Submenu in Each Page

<?php
if (is_page()) {
  $page = $post->ID;
  if ($post->post_parent) {
    $page = $post->post_parent;
  }
   $children=wp_list_pages( ‘child_of=’ . $page . ‘&title_li=’ );
  if ($children)
      {
    $output = wp_list_pages (‘child_of=’ . $page . ‘ ‘);
  }
}
echo $output;
?>