|
 |
16년 전 |
str_pad($test,3,'*' ,STR_PAD_LEFT)
str_pad(문자열 , 총자리수 , 채울문자, 왼쪽에채움/오른쪽에채움)
PHP.net 예제
<?php
$input = "Alien";
echo str_pad($input, 10); // produces "Alien "
echo str_pad($input, 10, "-=", STR_PAD_LEFT); // produces "-=-=-Alien"
echo str_pad($input, 10, "_", STR_PAD_BOTH); // produces "__Alien___"
echo str_pad($input, 6 , "___"); // produces "Alien_"
?>
당첨자발표 아이디 자를때 예제
<?
function cutID($txt,$count) {
$chr = str_pad(substr($txt,0,$count),strlen($txt),'*');
return $chr;
}
$id = "puresea00";
$id = cutID($id,2);
print $id;
?>
|
|
추천 : 453 |
추천
목록
|
|