Tôi đang cố gắng tạo số hóa đơn. Chúng phải luôn luôn là 4 số dài, ví dụ: với số 0 hàng đầu: ví dụ:
- 1 -> Hóa đơn 0001
- 10 -> Hóa đơn 0010
- 150 -> Hóa đơn 0150
etc.
hỏi ngày 9 tháng 6 năm 2011 lúc 17:25Jun 9, 2011 at 17:25
1
Sử dụng str_pad [].
$invID = str_pad[$invID, 4, '0', STR_PAD_LEFT];
Đã trả lời ngày 9 tháng 6 năm 2011 lúc 17:27Jun 9, 2011 at 17:27
WiseGuywiseGuyWiseguy
Huy hiệu vàng 20k8 64 Huy hiệu bạc79 Huy hiệu đồng8 gold badges64 silver badges79 bronze badges
12
Sử dụng sprintf
: //php.net/function.sprintf
$number = 51;
$number = sprintf['%04d',$number];
print $number;
// outputs 0051
$number = 8051;
$number = sprintf['%04d',$number];
print $number;
// outputs 8051
Đã trả lời ngày 9 tháng 6 năm 2011 lúc 17:29Jun 9, 2011 at 17:29
Chris Bakerchris BakerChris Baker
48.8K12 Huy hiệu vàng98 Huy hiệu bạc115 Huy hiệu đồng12 gold badges98 silver badges115 bronze badges
3
Sử dụng [s] ________ 9
printf['%04d',$number];
Đã trả lời ngày 9 tháng 6 năm 2011 lúc 17:27Jun 9, 2011 at 17:27
WiseGuywiseGuyWrikken
Huy hiệu vàng 20k8 64 Huy hiệu bạc79 Huy hiệu đồng8 gold badges93 silver badges135 bronze badges
Sử dụng sprintf
: //php.net/function.sprintf
$x = 1;
sprintf["%03d",$x];
echo $x;
Đã trả lời ngày 9 tháng 6 năm 2011 lúc 17:29Jun 9, 2011 at 17:28
Chris Bakerchris BakerDave
48.8K12 Huy hiệu vàng98 Huy hiệu bạc115 Huy hiệu đồng21 gold badges111 silver badges178 bronze badges
Sử dụng [s] ________ 94.
/**
* Add leading zeros to a number, if necessary
*
* @var int $value The number to add leading zeros
* @var int $threshold Threshold for adding leading zeros [number of digits
* that will prevent the adding of additional zeros]
* @return string
*/
function add_leading_zero[$value, $threshold = 2] {
return sprintf['%0' . $threshold . 's', $value];
}
add_leading_zero[1]; // 01
add_leading_zero[5]; // 05
add_leading_zero[100]; // 100
add_leading_zero[1]; // 001
add_leading_zero[5, 3]; // 005
add_leading_zero[100, 3]; // 100
add_leading_zero[1, 7]; // 0000001
WrikkenWrikkenJun 9, 2011 at 21:48
webjawns.comwebjawns.comwebjawns.com
67.6K8 Huy hiệu vàng93 Huy hiệu bạc135 Huy hiệu Đồng2 gold badges14 silver badges34 bronze badges
Thử cái này:str_pad function
//pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
Đã trả lời ngày 9 tháng 6 năm 2011 lúc 17:28
DavedaveSep 7, 2018 at 11:22
28.4K21 Huy hiệu vàng111 Huy hiệu bạc178 Huy hiệu đồngSani Kamal
0 hoạt động tốt nếu bạn luôn in một cái gì đó, nhưng printf['%04d',$number];
1 mang lại cho bạn sự linh hoạt hơn. Nếu bạn sử dụng chức năng này, printf['%04d',$number];
2 sẽ là 4.14
silver badges25 bronze badgesprintf['%04d',$number];
1
while [ strlen[$invoice_number] < 4 ] $invoice_num = '0' . $invoice_num;
Đã trả lời ngày 9 tháng 6 năm 2011 lúc 21:48
2.2802 Huy hiệu vàng14 Huy hiệu bạc34 Huy hiệu đồng17 gold badges156 silver badges321 bronze badges
Sử dụng chức năng STR_PADJun 9, 2011 at 17:30
1
$ num là số của bạn
Rustamabd@gmail-you-know-what ¶int is a number of the set ℤ = {..., -2, -1, 0, 1, 2, ...}.
Litbai ¶
- 6 năm trước
- Ẩn danh ¶
- 7 năm trước
18 năm trước
Darkshire ¶s can be specified in decimal [base 10], hexadecimal [base 16], octal [base 8] or binary [base 2] notation. The negation operator can be used to denote a negative int.
14 năm trước
Jacek ¶
Eric ¶
printf['%04d',$number];
9pere dot cil tại wanadoo dot fr ¶int literals is as of PHP 7.4.0 [previously, underscores have not been allowed]:
decimal : [1-9][0-9]*[_[0-9]+]* | 0 hexadecimal : 0[xX][0-9a-fA-F]+[_[0-9a-fA-F]+]* octal : 0[oO]?[0-7]+[_[0-7]+]* binary : 0[bB][01]+[_[01]+]* integer : decimal | hexadecimal | octal | binary
11 năm trướcint is platform-dependent, although a maximum value of about two billion is the usual value [that's 32 bits signed]. 64-bit platforms usually have a maximum value of about 9E18. PHP does not support unsigned ints. int size can be determined using the constant
0, maximum value using the constant $x = 1;
sprintf["%03d",$x];
echo $x;
1, and minimum value using the constant $x = 1;
sprintf["%03d",$x];
echo $x;
2. $x = 1;
sprintf["%03d",$x];
echo $x;
WBCarts tại Juno Dot Com ¶
13453814063 tại 163 dot com ¶int type, it will be interpreted as a float instead. Also, an operation which results in a number beyond the bounds of the int type will return a float instead.
Dewi tại Dewimorgan dot com
$x = 1;
sprintf["%03d",$x];
echo $x;
3JMW254 tại Cornell Dot Edu ¶
$x = 1;
sprintf["%03d",$x];
echo $x;
416 năm trướcint division operator in PHP, to achieve this use the intdiv[] function.
$x = 1;
sprintf["%03d",$x];
echo $x;
5 yields the float $x = 1;
sprintf["%03d",$x];
echo $x;
6. The value
can be cast to an int to round it towards zero, or the round[] function provides finer control over rounding. $x = 1;
sprintf["%03d",$x];
echo $x;
7Chuyển đổi sang số nguyên
Để chuyển đổi một cách rõ ràng một giá trị thành int, hãy sử dụng các diễn viên
$x = 1;
sprintf["%03d",$x];
echo $x;
8 hoặc $x = 1;
sprintf["%03d",$x];
echo $x;
9. Tuy nhiên, trong hầu hết các trường hợp, diễn viên không cần thiết, vì giá trị sẽ được tự động chuyển đổi nếu toán tử, hàm hoặc cấu trúc điều khiển yêu cầu đối số INT. Một giá trị cũng có thể được chuyển đổi thành int với hàm intval [].int, use either the $x = 1;
sprintf["%03d",$x];
echo $x;
8 or $x = 1;
sprintf["%03d",$x];
echo $x;
9 casts. However, in most cases the cast is not needed, since a value will be
automatically converted if an operator, function or control structure requires an int argument. A value can also be converted to int with the intval[] function. Nếu một tài nguyên được chuyển đổi thành INT, thì kết quả sẽ là số tài nguyên duy nhất được gán cho tài nguyên bằng PHP khi chạy.resource is converted to an int, then the result will be the unique resource number assigned to the resource by PHP at runtime.
Xem thêm Loại tung hứng.
Từ booleans
0 sẽ mang lại /**
* Add leading zeros to a number, if necessary
*
* @var int $value The number to add leading zeros
* @var int $threshold Threshold for adding leading zeros [number of digits
* that will prevent the adding of additional zeros]
* @return string
*/
function add_leading_zero[$value, $threshold = 2] {
return sprintf['%0' . $threshold . 's', $value];
}
add_leading_zero[1]; // 01
add_leading_zero[5]; // 05
add_leading_zero[100]; // 100
add_leading_zero[1]; // 001
add_leading_zero[5, 3]; // 005
add_leading_zero[100, 3]; // 100
add_leading_zero[1, 7]; // 0000001
3 [không] và printf['%04d',$number];
2 sẽ mang lại /**
* Add leading zeros to a number, if necessary
*
* @var int $value The number to add leading zeros
* @var int $threshold Threshold for adding leading zeros [number of digits
* that will prevent the adding of additional zeros]
* @return string
*/
function add_leading_zero[$value, $threshold = 2] {
return sprintf['%0' . $threshold . 's', $value];
}
add_leading_zero[1]; // 01
add_leading_zero[5]; // 05
add_leading_zero[100]; // 100
add_leading_zero[1]; // 001
add_leading_zero[5, 3]; // 005
add_leading_zero[100, 3]; // 100
add_leading_zero[1, 7]; // 0000001
3 [một]. will yield /**
* Add leading zeros to a number, if necessary
*
* @var int $value The number to add leading zeros
* @var int $threshold Threshold for adding leading zeros [number of digits
* that will prevent the adding of additional zeros]
* @return string
*/
function add_leading_zero[$value, $threshold = 2] {
return sprintf['%0' . $threshold . 's', $value];
}
add_leading_zero[1]; // 01
add_leading_zero[5]; // 05
add_leading_zero[100]; // 100
add_leading_zero[1]; // 001
add_leading_zero[5, 3]; // 005
add_leading_zero[100, 3]; // 100
add_leading_zero[1, 7]; // 0000001
printf['%04d',$number];
3 [zero], and /**
* Add leading zeros to a number, if necessary
*
* @var int $value The number to add leading zeros
* @var int $threshold Threshold for adding leading zeros [number of digits
* that will prevent the adding of additional zeros]
* @return string
*/
function add_leading_zero[$value, $threshold = 2] {
return sprintf['%0' . $threshold . 's', $value];
}
add_leading_zero[1]; // 01
add_leading_zero[5]; // 05
add_leading_zero[100]; // 100
add_leading_zero[1]; // 001
add_leading_zero[5, 3]; // 005
add_leading_zero[100, 3]; // 100
add_leading_zero[1, 7]; // 0000001
2 will yield /**
* Add leading zeros to a number, if necessary
*
* @var int $value The number to add leading zeros
* @var int $threshold Threshold for adding leading zeros [number of digits
* that will prevent the adding of additional zeros]
* @return string
*/
function add_leading_zero[$value, $threshold = 2] {
return sprintf['%0' . $threshold . 's', $value];
}
add_leading_zero[1]; // 01
add_leading_zero[5]; // 05
add_leading_zero[100]; // 100
add_leading_zero[1]; // 001
add_leading_zero[5, 3]; // 005
add_leading_zero[100, 3]; // 100
add_leading_zero[1, 7]; // 0000001
3 [one]. Từ số điểm nổi
Khi chuyển đổi từ phao sang INT, số sẽ được làm tròn về 0. Kể từ Php 8.1.0, một thông báo từ chối được phát ra khi ngầm chuyển đổi một chiếc phao không tích phân sang INT mất độ chính xác.float to int, the number will be rounded towards zero. As of PHP 8.1.0, a deprecation notice is emitted when implicitly converting a non-integral float to int which loses precision.
/**
* Add leading zeros to a number, if necessary
*
* @var int $value The number to add leading zeros
* @var int $threshold Threshold for adding leading zeros [number of digits
* that will prevent the adding of additional zeros]
* @return string
*/
function add_leading_zero[$value, $threshold = 2] {
return sprintf['%0' . $threshold . 's', $value];
}
add_leading_zero[1]; // 01
add_leading_zero[5]; // 05
add_leading_zero[100]; // 100
add_leading_zero[1]; // 001
add_leading_zero[5, 3]; // 005
add_leading_zero[100, 3]; // 100
add_leading_zero[1, 7]; // 0000001
4Nếu phao vượt quá ranh giới của INT [thường là
/**
* Add leading zeros to a number, if necessary
*
* @var int $value The number to add leading zeros
* @var int $threshold Threshold for adding leading zeros [number of digits
* that will prevent the adding of additional zeros]
* @return string
*/
function add_leading_zero[$value, $threshold = 2] {
return sprintf['%0' . $threshold . 's', $value];
}
add_leading_zero[1]; // 01
add_leading_zero[5]; // 05
add_leading_zero[100]; // 100
add_leading_zero[1]; // 001
add_leading_zero[5, 3]; // 005
add_leading_zero[100, 3]; // 100
add_leading_zero[1, 7]; // 0000001
5 trên các nền tảng 32 bit và /**
* Add leading zeros to a number, if necessary
*
* @var int $value The number to add leading zeros
* @var int $threshold Threshold for adding leading zeros [number of digits
* that will prevent the adding of additional zeros]
* @return string
*/
function add_leading_zero[$value, $threshold = 2] {
return sprintf['%0' . $threshold . 's', $value];
}
add_leading_zero[1]; // 01
add_leading_zero[5]; // 05
add_leading_zero[100]; // 100
add_leading_zero[1]; // 001
add_leading_zero[5, 3]; // 005
add_leading_zero[100, 3]; // 100
add_leading_zero[1, 7]; // 0000001
6 trên các nền tảng 64 bit], kết quả không được xác định, vì phao không có đủ độ chính xác để đưa ra kết quả INT chính xác. Không có cảnh báo, thậm chí không một thông báo sẽ được đưa ra khi điều này xảy ra!int [usually /**
* Add leading zeros to a number, if necessary
*
* @var int $value The number to add leading zeros
* @var int $threshold Threshold for adding leading zeros [number of digits
* that will prevent the adding of additional zeros]
* @return string
*/
function add_leading_zero[$value, $threshold = 2] {
return sprintf['%0' . $threshold . 's', $value];
}
add_leading_zero[1]; // 01
add_leading_zero[5]; // 05
add_leading_zero[100]; // 100
add_leading_zero[1]; // 001
add_leading_zero[5, 3]; // 005
add_leading_zero[100, 3]; // 100
add_leading_zero[1, 7]; // 0000001
5 on 32-bit
platforms and /**
* Add leading zeros to a number, if necessary
*
* @var int $value The number to add leading zeros
* @var int $threshold Threshold for adding leading zeros [number of digits
* that will prevent the adding of additional zeros]
* @return string
*/
function add_leading_zero[$value, $threshold = 2] {
return sprintf['%0' . $threshold . 's', $value];
}
add_leading_zero[1]; // 01
add_leading_zero[5]; // 05
add_leading_zero[100]; // 100
add_leading_zero[1]; // 001
add_leading_zero[5, 3]; // 005
add_leading_zero[100, 3]; // 100
add_leading_zero[1, 7]; // 0000001
6 on 64-bit platforms], the result is undefined, since the float doesn't have enough precision to give an exact int result. No warning, not even a notice will be issued when this happens! Ghi chú::
Nan và Infinity sẽ luôn bằng không khi được đúc vào Int.int.
Cảnh báo
Không bao giờ sử dụng một phần không xác định cho Int, vì điều này đôi khi có thể dẫn đến kết quả bất ngờ.int, as this can sometimes lead to unexpected results.
/**
* Add leading zeros to a number, if necessary
*
* @var int $value The number to add leading zeros
* @var int $threshold Threshold for adding leading zeros [number of digits
* that will prevent the adding of additional zeros]
* @return string
*/
function add_leading_zero[$value, $threshold = 2] {
return sprintf['%0' . $threshold . 's', $value];
}
add_leading_zero[1]; // 01
add_leading_zero[5]; // 05
add_leading_zero[100]; // 100
add_leading_zero[1]; // 001
add_leading_zero[5, 3]; // 005
add_leading_zero[100, 3]; // 100
add_leading_zero[1, 7]; // 0000001
7Xem thêm cảnh báo về độ chính xác nổi.
Từ chuỗi
Nếu chuỗi là số hoặc số dẫn thì nó sẽ giải quyết thành giá trị số nguyên tương ứng, nếu không nó được chuyển đổi thành 0 [
printf['%04d',$number];
3].Từ nullNULL
9 luôn được chuyển đổi thành 0 [/**
* Add leading zeros to a number, if necessary
*
* @var int $value The number to add leading zeros
* @var int $threshold Threshold for adding leading zeros [number of digits
* that will prevent the adding of additional zeros]
* @return string
*/
function add_leading_zero[$value, $threshold = 2] {
return sprintf['%0' . $threshold . 's', $value];
}
add_leading_zero[1]; // 01
add_leading_zero[5]; // 05
add_leading_zero[100]; // 100
add_leading_zero[1]; // 001
add_leading_zero[5, 3]; // 005
add_leading_zero[100, 3]; // 100
add_leading_zero[1, 7]; // 0000001
3]. is always converted to zero [printf['%04d',$number];
printf['%04d',$number];
3]. Từ các loại khác
Thận trọng
Hành vi chuyển đổi sang INT không được xác định cho các loại khác. Không dựa vào bất kỳ hành vi quan sát nào, vì nó có thể thay đổi mà không cần thông báo trước.int is undefined for other types. Do not rely on any observed behaviour, as it can change without notice.
PHP tại Richardneill Dot org ¶ ¶
9 năm trước
//pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
1D_N tại Nospam Dot Loryx Dot Com ¶ ¶
15 năm trước
//pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
2 //pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
3 //pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
4 //pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
5 //pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
6Dhairya lakhera ¶ ¶
4 năm trước
//pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
7 //pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
8 //pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
9while [ strlen[$invoice_number] < 4 ] $invoice_num = '0' . $invoice_num;
0while [ strlen[$invoice_number] < 4 ] $invoice_num = '0' . $invoice_num;
1while [ strlen[$invoice_number] < 4 ] $invoice_num = '0' . $invoice_num;
2while [ strlen[$invoice_number] < 4 ] $invoice_num = '0' . $invoice_num;
3while [ strlen[$invoice_number] < 4 ] $invoice_num = '0' . $invoice_num;
4while [ strlen[$invoice_number] < 4 ] $invoice_num = '0' . $invoice_num;
5while [ strlen[$invoice_number] < 4 ] $invoice_num = '0' . $invoice_num;
6while [ strlen[$invoice_number] < 4 ] $invoice_num = '0' . $invoice_num;
7 //pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
6Egwayjen tại gmail dot com ¶
4 năm trước
while [ strlen[$invoice_number] < 4 ] $invoice_num = '0' . $invoice_num;
9Egwayjen tại gmail dot com ¶
Ganlvtech tại qq dot com ¶
decimal : [1-9][0-9]*[_[0-9]+]* | 0 hexadecimal : 0[xX][0-9a-fA-F]+[_[0-9a-fA-F]+]* octal : 0[oO]?[0-7]+[_[0-7]+]* binary : 0[bB][01]+[_[01]+]* integer : decimal | hexadecimal | octal | binary0
decimal : [1-9][0-9]*[_[0-9]+]* | 0 hexadecimal : 0[xX][0-9a-fA-F]+[_[0-9a-fA-F]+]* octal : 0[oO]?[0-7]+[_[0-7]+]* binary : 0[bB][01]+[_[01]+]* integer : decimal | hexadecimal | octal | binary1
decimal : [1-9][0-9]*[_[0-9]+]* | 0 hexadecimal : 0[xX][0-9a-fA-F]+[_[0-9a-fA-F]+]* octal : 0[oO]?[0-7]+[_[0-7]+]* binary : 0[bB][01]+[_[01]+]* integer : decimal | hexadecimal | octal | binary2
decimal : [1-9][0-9]*[_[0-9]+]* | 0 hexadecimal : 0[xX][0-9a-fA-F]+[_[0-9a-fA-F]+]* octal : 0[oO]?[0-7]+[_[0-7]+]* binary : 0[bB][01]+[_[01]+]* integer : decimal | hexadecimal | octal | binary3
2 năm trước ¶
Ganlvtech tại qq dot com ¶
decimal : [1-9][0-9]*[_[0-9]+]* | 0 hexadecimal : 0[xX][0-9a-fA-F]+[_[0-9a-fA-F]+]* octal : 0[oO]?[0-7]+[_[0-7]+]* binary : 0[bB][01]+[_[01]+]* integer : decimal | hexadecimal | octal | binary4
decimal : [1-9][0-9]*[_[0-9]+]* | 0 hexadecimal : 0[xX][0-9a-fA-F]+[_[0-9a-fA-F]+]* octal : 0[oO]?[0-7]+[_[0-7]+]* binary : 0[bB][01]+[_[01]+]* integer : decimal | hexadecimal | octal | binary5
decimal : [1-9][0-9]*[_[0-9]+]* | 0 hexadecimal : 0[xX][0-9a-fA-F]+[_[0-9a-fA-F]+]* octal : 0[oO]?[0-7]+[_[0-7]+]* binary : 0[bB][01]+[_[01]+]* integer : decimal | hexadecimal | octal | binary6
decimal : [1-9][0-9]*[_[0-9]+]* | 0 hexadecimal : 0[xX][0-9a-fA-F]+[_[0-9a-fA-F]+]* octal : 0[oO]?[0-7]+[_[0-7]+]* binary : 0[bB][01]+[_[01]+]* integer : decimal | hexadecimal | octal | binary7
2 năm trước ¶
15 năm trước
decimal : [1-9][0-9]*[_[0-9]+]* | 0 hexadecimal : 0[xX][0-9a-fA-F]+[_[0-9a-fA-F]+]* octal : 0[oO]?[0-7]+[_[0-7]+]* binary : 0[bB][01]+[_[01]+]* integer : decimal | hexadecimal | octal | binary8
Dhairya lakhera ¶ ¶
4 năm trước
decimal : [1-9][0-9]*[_[0-9]+]* | 0 hexadecimal : 0[xX][0-9a-fA-F]+[_[0-9a-fA-F]+]* octal : 0[oO]?[0-7]+[_[0-7]+]* binary : 0[bB][01]+[_[01]+]* integer : decimal | hexadecimal | octal | binary9
Egwayjen tại gmail dot com ¶
Ganlvtech tại qq dot com ¶
$invID = str_pad[$invID, 4, '0', STR_PAD_LEFT];
0
Egwayjen tại gmail dot com ¶
15 năm trước
$invID = str_pad[$invID, 4, '0', STR_PAD_LEFT];
1
$invID = str_pad[$invID, 4, '0', STR_PAD_LEFT];
2
$invID = str_pad[$invID, 4, '0', STR_PAD_LEFT];
3
//pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
6Egwayjen tại gmail dot com ¶
Ganlvtech tại qq dot com ¶
$invID = str_pad[$invID, 4, '0', STR_PAD_LEFT];
5
$invID = str_pad[$invID, 4, '0', STR_PAD_LEFT];
6
//pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
62 năm trước ¶
Kuzawinski Dot Marcin_Nospam tại Gmail Dot Com ¶
$invID = str_pad[$invID, 4, '0', STR_PAD_LEFT];
8
$invID = str_pad[$invID, 4, '0', STR_PAD_LEFT];
9
//pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
6Rustamabd@gmail-you-know-what ¶ ¶
15 năm trước
sprintf
1
Dhairya lakhera ¶ ¶
Kuzawinski Dot Marcin_Nospam tại Gmail Dot Com ¶
sprintf
2
sprintf
3
sprintf
4
sprintf
5
sprintf
6
sprintf
7
sprintf
8
sprintf
9
//pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
6Rustamabd@gmail-you-know-what ¶ ¶
Litbai ¶
printf
1
printf
2
printf
3
printf
4
printf
5
printf
6
//pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
66 năm trước ¶
Kuzawinski Dot Marcin_Nospam tại Gmail Dot Com ¶
printf
8
printf
9
printf['%04d',$number];
00printf['%04d',$number];
01Rustamabd@gmail-you-know-what ¶ ¶
4 năm trước
printf['%04d',$number];
02Egwayjen tại gmail dot com ¶
Ganlvtech tại qq dot com ¶
printf['%04d',$number];
03printf['%04d',$number];
04printf['%04d',$number];
05printf['%04d',$number];
06printf['%04d',$number];
07printf['%04d',$number];
08printf['%04d',$number];
09printf['%04d',$number];
10 //pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
62 năm trước ¶
Kuzawinski Dot Marcin_Nospam tại Gmail Dot Com ¶
printf['%04d',$number];
12printf['%04d',$number];
13printf['%04d',$number];
14printf['%04d',$number];
15 //pad to left side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_LEFT]
//pad to right side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_RIGHT]
//pad to both side of the input
$my_val=str_pad[$num, 3, '0', STR_PAD_BOTH]
6