Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Replace all occurrences of the search string with the replacement string
<?php str_replace( array|string $search, array|string $replace, string|array $subject, int &$count = null): string|array
<?php $encoded_uri = str_replace('%2F', '/', rawurlencode($canonical_uri));
if ($AWSRegion == 'us-east-1') {
<?php private static function updateComposerAutoloading(): void
{
$updatedStaticLoader = str_replace(
"__DIR__ . '/../..'",
sprintf("'%s'", rtrim(getenv('LAMBDA_TASK_ROOT'), '/')),
file_get_contents(self::AUTOLOAD_STATIC_PATH)
);
file_put_contents(self::AUTOLOAD_STATIC_PATH, $updatedStaticLoader);
}
<?php $encoded_uri = str_replace('%2F', '/', rawurlencode($canonical_uri));
if ($AWSRegion == 'us-east-1') {
<?php private static function updateComposerAutoloading(): void
{
$updatedStaticLoader = str_replace(
"__DIR__ . '/../..'",
sprintf("'%s'", rtrim(getenv('LAMBDA_TASK_ROOT'), '/')),
file_get_contents(self::AUTOLOAD_STATIC_PATH)
);
file_put_contents(self::AUTOLOAD_STATIC_PATH, $updatedStaticLoader);
}
<?php $encoded_uri = str_replace('%2F', '/', rawurlencode($canonical_uri));
if ($AWSRegion == 'us-east-1') {
<?php private static function updateComposerAutoloading(): void
{
$updatedStaticLoader = str_replace(
"__DIR__ . '/../..'",
sprintf("'%s'", rtrim(getenv('LAMBDA_TASK_ROOT'), '/')),
file_get_contents(self::AUTOLOAD_STATIC_PATH)
);
file_put_contents(self::AUTOLOAD_STATIC_PATH, $updatedStaticLoader);
}
<?php $template = file_get_contents("$rootPath/serverless.yml");
$template = str_replace('PHP_VERSION', PHP_MAJOR_VERSION . PHP_MINOR_VERSION, $template);
file_put_contents('serverless.yml', $template);
<?php }
foreach ($event->getHeaders() as $header => $values) {
foreach ($values as $value) {
$key = 'HTTP_' . strtoupper(str_replace('-', '_', $header));
$request->setCustomVar($key, $value);
}
}
<?php private function capitalizeHeaderName(string $name): string
{
$name = str_replace('-', ' ', $name);
$name = ucwords($name);
return str_replace(' ', '-', $name);
}
<?php {
$name = str_replace('-', ' ', $name);
$name = ucwords($name);
return str_replace(' ', '-', $name);
}
}