php日历
<?phpclass Calendar { private $year; private $month; private $val; private $weeks = array ('日', '一', '二', '三', '四', '五', '六' ); function __construct($options = array(), $val) { $this->year = date ( 'Y' ); $this->month = date ( 'm' ); $this->val = $val; $vars = get_class_vars ( get_class ( $this ) ); foreach ( $options as $key => $value ) { if (array_key_exists ( $key, $vars )) { $this->$key = $value; } } } function display() { $value .= '<table class="calendar">'; $value .= $this->showChangeDate (); $value .= $this->showWeeks (); $value .= $this->showDays ( $this->year, $this->month ); $value .= '</table>'; return $value; } private function showWeeks() { $value .= '<tr>'; foreach ( $this->weeks as $title ) { $value .= '<th>' . $title . '</th>'; } $value .= '</tr>'; return $value; } private function showDays($year, $month) { $nowtime = mktime(0,0,0,$month,1,$year);//当月1号转为秒 $daysofmonth = date(t,$nowtime);//当月天数 $weekofbeginday = date(w,$nowtime);//当月第一天是星期几 $weekofendday = date(w,mktime(0,0,0,$month+1,0,$year));//当月最后一天是星期几 $daysofprevmonth = date(t,mktime(0,0,0,$month,0,$year));//上个月天数 $count = 1;//计数 //列出上月后几天 for($i = 1 ; $i <= $weekofbeginday ; $i++) { $value .= "<td>".($daysofprevmonth-$weekofbeginday+$i)."</td>"; $count++; } //当月全部 for($i = 1 ; $i <= $daysofmonth ; $i++) { $css = ($count%7==0 || $count%7==1)?"weekday":"normalday"; if($i == $today) $css .= "today"; $value .= "<td class='".$css."'>".$i."</td>"; if($count%7==0) $value .= "</tr><tr>"; $count++; } //下月前几天 for ($i = 1;$i <= 6-$weekofendday;$i++) { $value .= "<td class='othermonth'>".$i."</td>"; } $value .= '</tr>'; return $value; } private function showChangeDate() { $url = basename ( $_SERVER ['PHP_SELF'] ); $value = '<tr>'; $value .= '<td><a href="?' . $this->preYearUrl ( $this->year, $this->month ) . '">' . '上年' . '</a></td>'; $value .= '<td><a href="?' . $this->preMonthUrl ( $this->year, $this->month ) . '">' . '上月' . '</a></td>'; $value .= '<td colspan="3"><form>'; $value .= '<select name="year" onchange="window.location=\'' . $url . '?year=\'+this.options[selectedIndex].value+\'&month=' . $this->month . '\'">'; for($ye = 1970; $ye <= 2038; $ye ++) { $selected = ($ye == $this->year) ? 'selected' : ''; $value .= '<option ' . $selected . ' value="' . $ye . '">' . $ye . '</option>'; } $value .= '</select>'; $value .= '<select name="month" onchange="window.location=\'' . $url . '?year=' . $this->year . '&month=\'+this.options[selectedIndex].value+\'\'">'; for($mo = 1; $mo <= 12; $mo ++) { $selected = ($mo == $this->month) ? 'selected' : ''; $value .= '<option ' . $selected . ' value="' . $mo . '">' . $mo . '</option>'; } $value .= '</select>'; $value .= '</form></td>'; $value .= '<td><a href="?' . $this->nextMonthUrl ( $this->year, $this->month ) . '">' . '下月' . '</a></td>'; $value .= '<td><a href="?' . $this->nextYearUrl ( $this->year, $this->month ) . '">' . '下年' . '</a></td>'; $value .= '</tr>'; return $value; } private function preYearUrl($year, $month) { $year = ($this->year <= 1970) ? 1970 : $year - 1; return 'year=' . $year . '&month=' . $month; } private function nextYearUrl($year, $month) { $year = ($year >= 2038) ? 2038 : $year + 1; return 'year=' . $year . '&month=' . $month; } private function preMonthUrl($year, $month) { if ($month == 1) { $month = 12; $year = ($year <= 1970) ? 1970 : $year - 1; } else { $month --; } return 'year=' . $year . '&month=' . $month; } private function nextMonthUrl($year, $month) { if ($month == 12) { $month = 1; $year = ($year >= 2038) ? 2038 : $year + 1; } else { $month ++; } return 'year=' . $year . '&month=' . $month; }}
<?php//获取日历$year = date ( "Y" );$month = date ( "m" );$params = array ('year' => $year, 'month' => $month );if (isset ( $_GET ['year'] ) && isset ( $_GET ['month'] )) { $params = array ('year' => $_GET ['year'], 'month' => $_GET ['month'] ); $year = $_GET ['year']; $month = $_GET ['month'];}$cal = new Calendar ( $params, $list_sign );echo $cal->display ();?>

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











Alipay PHP ...

JWT는 주로 신분증 인증 및 정보 교환을 위해 당사자간에 정보를 안전하게 전송하는 데 사용되는 JSON을 기반으로 한 개방형 표준입니다. 1. JWT는 헤더, 페이로드 및 서명의 세 부분으로 구성됩니다. 2. JWT의 작업 원칙에는 세 가지 단계가 포함됩니다. JWT 생성, JWT 확인 및 Parsing Payload. 3. PHP에서 인증에 JWT를 사용하면 JWT를 생성하고 확인할 수 있으며 사용자 역할 및 권한 정보가 고급 사용에 포함될 수 있습니다. 4. 일반적인 오류에는 서명 검증 실패, 토큰 만료 및 대형 페이로드가 포함됩니다. 디버깅 기술에는 디버깅 도구 및 로깅 사용이 포함됩니다. 5. 성능 최적화 및 모범 사례에는 적절한 시그니처 알고리즘 사용, 타당성 기간 설정 합리적,

기사는 PHP 5.3에 도입 된 PHP의 LSB (Late STATIC BING)에 대해 논의하여 정적 방법의 런타임 해상도가보다 유연한 상속을 요구할 수있게한다. LSB의 실제 응용 프로그램 및 잠재적 성능

기사는 입력 유효성 검사, 인증 및 정기 업데이트를 포함한 취약점을 방지하기 위해 프레임 워크의 필수 보안 기능을 논의합니다.

이 기사에서는 프레임 워크에 사용자 정의 기능 추가, 아키텍처 이해, 확장 지점 식별 및 통합 및 디버깅을위한 모범 사례에 중점을 둡니다.

PHP 개발에서 PHP의 CURL 라이브러리를 사용하여 JSON 데이터를 보내면 종종 외부 API와 상호 작용해야합니다. 일반적인 방법 중 하나는 컬 라이브러리를 사용하여 게시물을 보내는 것입니다 ...

PHP 개발에서 견고한 원칙의 적용에는 다음이 포함됩니다. 1. 단일 책임 원칙 (SRP) : 각 클래스는 하나의 기능 만 담당합니다. 2. Open and Close Principle (OCP) : 변경은 수정보다는 확장을 통해 달성됩니다. 3. Lisch의 대체 원칙 (LSP) : 서브 클래스는 프로그램 정확도에 영향을 미치지 않고 기본 클래스를 대체 할 수 있습니다. 4. 인터페이스 격리 원리 (ISP) : 의존성 및 사용되지 않은 방법을 피하기 위해 세밀한 인터페이스를 사용하십시오. 5. 의존성 반전 원리 (DIP) : 높고 낮은 수준의 모듈은 추상화에 의존하며 종속성 주입을 통해 구현됩니다.

세션 납치는 다음 단계를 통해 달성 할 수 있습니다. 1. 세션 ID를 얻으십시오. 2. 세션 ID 사용, 3. 세션을 활성 상태로 유지하십시오. PHP에서 세션 납치를 방지하는 방법에는 다음이 포함됩니다. 1. 세션 _regenerate_id () 함수를 사용하여 세션 ID를 재생산합니다. 2. 데이터베이스를 통해 세션 데이터를 저장하십시오.
