try exception inside a for loop : i trying to build a for loop with an exception, this is the code:

    for( $i = 1; $i <= $contxf; $i++) {
      try{
        if($i = $icheck) {
          throw new Exception('Current Page');
      }
      echo '<a href="?pag='.$i.'">'. $i .'</a>&nbsp';
      } catch (Exception $cp) {
        echo $i;
        $i = $i + 1;
      }

But with this code the loop don't continue to add 1 to $i 
