strtr
laravel/framework
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Translate characters or replace substrings
strtr
(
string $string
,
string $from
,
string $to
):
string
protected function
transformHeadersToServerVars
(array
$headers
)
{
return
collect
(
array_merge
(
$this
->
defaultHeaders
,
$headers
))->
mapWithKeys
(function (
$value
,
$name
) {
$name
=
strtr
(
strtoupper
(
$name
),
'-'
,
'_'
);
return [
$this
->
formatServerHeaderKey
(
$name
) =>
$value
];
})->
all
();
src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php
$uri
=
strtr
(
rawurlencode
(
$uri
),
$this
->
dontEncode
);
if (!
$absolute
) {
$uri
=
preg_replace
(
'#^(//|[^/?])+#'
,
''
,
$uri
);
src/Illuminate/Routing/RouteUrlGenerator.php
public static function
swap
(array
$map
,
$subject
)
{
return
strtr
(
$subject
,
$map
);
}
src/Illuminate/Support/Str.php
public function
swap
(array
$map
)
{
return new static(
strtr
(
$this
->
value
,
$map
));
}
src/Illuminate/Support/Stringable.php
$shouldReplace
[
':'
.
$key
] =
$value
;
}
return
strtr
(
$line
,
$shouldReplace
);
}
src/Illuminate/Translation/Translator.php
protected function
compileParent
()
{
$escapedLastSection
=
strtr
(
$this
->
lastSection
, [
'\\'
=>
'\\\\'
,
"'"
=>
"\\'"
]);
return
"<?php echo \Illuminate\View\Factory::parentPlaceholder('
{
$escapedLastSection
}
'); ?>"
;
}
src/Illuminate/View/Compilers/Concerns/CompilesLayouts.php