Warning: include(../lntop.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/str-pad.html on line 19

Warning: include() [function.include]: Failed opening '../lntop.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/str-pad.html on line 19

Warning: include(../levoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/str-pad.html on line 46

Warning: include() [function.include]: Failed opening '../levoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/str-pad.html on line 46



Учебник РНР
НазадВперёд

str_pad

(PHP 4 >= 4.0.1)

str_pad - заполняет строку определённой длины другой строкой.

Описание

string str_pad (string input, int pad_length [, string pad_string [, int pad_type]])

Эта функция возвращает строку input, заполненную влево, вправо или в обоих направлениях на специфицированную длину. Если необязательный аргумент pad_string отсутствует, input заполняется пробелами, иначе заполняется символами из pad_string до верхней границы.

Необязательный аргумент pad_type может быть: STR_PAD_RIGHT, STR_PAD_LEFT или STR_PAD_BOTH. Если pad_type не специфицирован, принимается STR_PAD_RIGHT.

Если значение pad_length отрицательное или меньше длины input-строки, заполнение не выполняется.

Пример 1. str_pad()
$input = "Alien";
print str_pad($input, 10);                      // даёт "Alien     "
print str_pad($input, 10, "-=", STR_PAD_LEFT);  // даёт "-=-=-Alien"
print str_pad($input, 10, "_", STR_PAD_BOTH);   // даёт "__Alien___"

Назад Оглавление Вперёд
sscanf Вверхstr_repeat


Warning: include(../pravoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/str-pad.html on line 147

Warning: include() [function.include]: Failed opening '../pravoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/str-pad.html on line 147

Rambler's Top100
© 2009 Тест скорости интернета |  Boont.Ru

Warning: include(../lnbottom.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/str-pad.html on line 273

Warning: include() [function.include]: Failed opening '../lnbottom.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/str-pad.html on line 273