PHP--str_pad()函数用法
2006-04-19 13:57
721 查看
str_pad -- Pad a string to a certain length with another string
This functions returns the input string padded on the left, the right, or both sides to the specified padding length. If the optional argument pad_string is not supplied, the input is padded with spaces, otherwise it is padded with characters from pad_string up to the limit.
Optional argument pad_type can be STR_PAD_RIGHT, STR_PAD_LEFT, or STR_PAD_BOTH. If pad_type is not specified it is assumed to be STR_PAD_RIGHT.
If the value of pad_length is negative or less than the length of the input string, no padding takes place.
补齐字符串的长度.以pad_string 补.
Description
string str_pad ( string input, int pad_length [, string pad_string [, int pad_type]])This functions returns the input string padded on the left, the right, or both sides to the specified padding length. If the optional argument pad_string is not supplied, the input is padded with spaces, otherwise it is padded with characters from pad_string up to the limit.
Optional argument pad_type can be STR_PAD_RIGHT, STR_PAD_LEFT, or STR_PAD_BOTH. If pad_type is not specified it is assumed to be STR_PAD_RIGHT.
If the value of pad_length is negative or less than the length of the input string, no padding takes place.
例子 1. [b]str_pad() example[/b]
|
相关文章推荐
- php str_pad 函数用法简介
- php str_pad 函数用法简介
- php中str_pad()函数用法分析
- php str_pad 函数使用详解
- PHP str_pad() 函数 初级系列10
- PHP str_pad() 函数 初级系列9
- php 截取字符串并以零补齐str_pad() 函数
- PHP将字符串填充到指定长度 str_pad()函数
- php如何截取字符串并以零补齐str_pad() 函数
- php如何截取字符串并以零补齐str_pad() 函数
- php parse_str() 函数的定义和用法
- php 截取字符串并以零补齐str_pad() 函数
- php str_pad() 用法
- php如何截取字符串并以零补齐str_pad() 函数
- PHP字符串分割函数explode,strtok,str_spli的用法
- php中利用str_pad函数生成数字递增形式的产品编号
- PHP str_replace() 函数 & strtr() 函数 的常见用法
- 详解PHP字符串替换str_replace()函数四种用法
- php str_pad()函数
- PHP字符串替换str_replace()函数4种用法详解