자릿수만큼 앞에 0 붙이기
작성일 12-08-29 14:06
페이지 정보
작성자서방님 조회 324회 댓글 0건본문
$str = 8
$result = str_pad($str, 4, 0, STR_PAD_LEFT);
echo $result;
0008
또는
$a = 8;
$new_a = sprintf("%04d", $a);
0008
댓글목록
등록된 댓글이 없습니다.
작성일 12-08-29 14:06
$str = 8
$result = str_pad($str, 4, 0, STR_PAD_LEFT);
echo $result;
0008
또는
$a = 8;
$new_a = sprintf("%04d", $a);
0008
등록된 댓글이 없습니다.