웹프로그램
PHP 문자수 자리 고정
세이박스
2008. 10. 19. 20:11
반응형
1로 넘어오는 변수를 "001"로 세자리수 맞춤.
$sj_src=sprintf("%03d", $vl_no);
######
To have a string with leading zeros use this:
$string_i = sprintf("%04s",$value)
Gives you an output with leading zeros and 4 digits.
i.e.
0001
0002
...
0010
an so on
반응형