ltrim
symfony/var-dumper
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Strip whitespace (or other characters) from the beginning of a string
ltrim
(
string $string
,
string $characters
=
" \n\r\t\v\x00"
):
string
foreach (
$src
as
$i
=>
$c
) {
if (
$ltrim
) {
$c
= isset(
$c
[
$ltrim
]) &&
"\r"
!==
$c
[
$ltrim
] ?
substr
(
$c
,
$ltrim
) :
ltrim
(
$c
,
" \t"
);
}
$c
=
substr
(
$c
,
0
, -
1
);
if (
$i
!==
$srcContext
) {
Caster/ExceptionCaster.php
if (
null
!==
$this
->
projectDir
) {
$context
[
'project_dir'
] =
$this
->
projectDir
;
if (
str_starts_with
(
$file
,
$this
->
projectDir
)) {
$context
[
'file_relative'
] =
ltrim
(
substr
(
$file
,
\strlen
(
$this
->
projectDir
)),
\DIRECTORY_SEPARATOR
);
}
}
Dumper/ContextProvider/SourceContextProvider.php