Notice
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- proxy
- 재귀약자
- implode
- trim
- ipaddress
- str_replace
- explode
- node.js
- array
- 개발환경
- 터미널
- 함수
- hyper
- php
- require_once
- npm
- include
- require
- recursive acronym
- array_map
- 배열
- phpinfo
- RTRIM
- include_once
- 프록시
- LTRIM
- WSL2
- 문자열
- nvm
- 몫과나머지
- Today
- 9
- Total
- 31,137
목록2020/05 (1)
PHPINFO

$b를 $a로 나누었을 때의 몫과 나머지 # $b를 $a로 나누었을 때의 몫과 나머지 구하기 //몫 구하는 방법 1 $quotient = ($b - ($b % $a)) / $a; //몫 구하는 방법 2 $quotient = sprintf('%d', $b / $a); // 나머지 구하는 방법 $remainder = $b % $a; 함수로 간단히 몫과 나머지 구하는 예제 function getQuotientAndRemainder($divisor, $dividend) { $quotient = (int)($divisor / $dividend); $remainder = $divisor % $dividend; return array( $quotient, $remainder ); } list($quotient, $r..
PHP
2020. 5. 26. 21:10