code: private function formatN(&$str) {
      if (strstr($str, '%N')) {
        $wdn = $this->weekDayNum();  // Convert 0=Mon 6=Sun to above format
        $str = str_replace('%N', $wdn == 0 ? 7 : $wdn, $str);
      }
    }
docs: ISO-8601 numeric representation of the day of the week 1=Mon, 7=Sun
  @param type $str