# 소스 코드
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=euc-kr"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <title>Hello PHP World</title> </head> <body> <div class="container"> <?php $now_year = 2016; $now_month = 11; $now_day = 29; $birth_year = 1992; $birth_month = 10; $birth_day = 12; if($birth_month < $now_month){ $age = $now_year - $birth_day; }else if($birth_month == $now_day){ if($birth_day <= $now_day){ $age = $now_year - $birth_year; }else{ $age = $now_year - $birth_year-1; } } ?> 오늘 날짜 : <?= $now_year ?> 년 <?= $now_month ?> 월 <?= $now_day ?> 일<br/> 출생 연월일 : <?= $birth_year ?> 년 <?= $birth_month ?> 월 <?= $birth_day ?> 일생<br/> 만 나이 : <?= $age ?>세 </div> </body> </html> | cs |
해당 소스는 제가 학생때 연습삼아 만든 소스 입니다.
'잡다한 기술' 카테고리의 다른 글
[jQuery/제이쿼리]클래스 확인, 클래스 추가, 클래스 제거 removeClass(), addClass(), hasClass() (0) | 2018.02.19 |
---|---|
[K-Move/해외인턴/IT인턴]미국에 가기전 준비할 것-1(해외에 가기전 챙겨야 할 것) (0) | 2018.02.15 |
[아두이노] 아두이노 라이브러리 추가 방법(내부/외부 라이브러리) (0) | 2018.02.14 |
[아두이노] 아두이노 TinyGPS 라이브러리가 위치 파싱을 못할 경우 (0) | 2018.02.14 |
[안드로이드/아두이노] 안드로이드와 아두이노를 이용한 블루투스 통신 위치추적기 (0) | 2018.02.14 |