str_pad
laravel/framework
Supported Versions: PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8
Pad a string to a certain length with another string
str_pad
(
string $string
,
int $length
,
string $pad_string
=
" "
,
int $pad_type
=
STR_PAD_RIGHT
):
string
$expressions
=
explode
(
' '
,
$expression
);
return
collect
(
$spacing
)
->
map
(fn (
$length
,
$index
) =>
str_pad
(
$expressions
[
$index
],
$length
))
->
implode
(
' '
);
}
src/Illuminate/Console/Scheduling/ScheduleListCommand.php
}
if (!
$value
instanceof
Expression
) {
$value
=
str_pad
(
$value
,
2
,
'0'
,
STR_PAD_LEFT
);
}
return
$this
->
addDateBasedWhere
(
'Day'
,
$column
,
$operator
,
$value
,
$boolean
);
src/Illuminate/Database/Query/Builder.php
}
if (!
$value
instanceof
Expression
) {
$value
=
str_pad
(
$value
,
2
,
'0'
,
STR_PAD_LEFT
);
}
return
$this
->
addDateBasedWhere
(
'Month'
,
$column
,
$operator
,
$value
,
$boolean
);
src/Illuminate/Database/Query/Builder.php
public static function
padBoth
(
$value
,
$length
,
$pad
=
' '
)
{
return
str_pad
(
$value
,
strlen
(
$value
) -
mb_strlen
(
$value
) +
$length
,
$pad
,
STR_PAD_BOTH
);
}
src/Illuminate/Support/Str.php
public static function
padLeft
(
$value
,
$length
,
$pad
=
' '
)
{
return
str_pad
(
$value
,
strlen
(
$value
) -
mb_strlen
(
$value
) +
$length
,
$pad
,
STR_PAD_LEFT
);
}
src/Illuminate/Support/Str.php
public static function
padRight
(
$value
,
$length
,
$pad
=
' '
)
{
return
str_pad
(
$value
,
strlen
(
$value
) -
mb_strlen
(
$value
) +
$length
,
$pad
,
STR_PAD_RIGHT
);
}
src/Illuminate/Support/Str.php