Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Strip whitespace (or other characters) from the end of a string
<?php rtrim(string $string, string $characters = " \n\r\t\v\x00"): string
<?php $string = $messages;
}
return strlen($string) - strlen(rtrim($string, PHP_EOL));
}
<?php $relativeTarget = (new SymfonyFilesystem)->makePathRelative($target, dirname($link));
$this->link($this->isFile($target) ? rtrim($relativeTarget, '/') : $relativeTarget, $link);
}
<?php protected function concatPathToUrl($url, $path)
{
return rtrim($url, '/').'/'.ltrim($path, '/');
}
<?php public static function setFacadeNamespace($namespace)
{
static::$facadeNamespace = rtrim($namespace, '\\').'\\';
}
<?php public function setBasePath($basePath)
{
$this->basePath = rtrim($basePath, '\/');
$this->bindPathsInContainer();
<?php public function viewPath($path = '')
{
$viewPath = rtrim($this['config']->get('view.paths')[0], DIRECTORY_SEPARATOR);
return $this->joinPaths($viewPath, $path);
}
<?php }
if (is_file(public_path($manifestDirectory.'/hot'))) {
$url = rtrim(file_get_contents(public_path($manifestDirectory.'/hot')));
$customUrl = app('config')->get('app.mix_hot_proxy_url');
<?php protected function hotAsset($asset)
{
return rtrim(file_get_contents($this->hotFile())).'/'.$asset;
}
<?php public function send(string $method, string $url, array $options = [])
{
if (! Str::startsWith($url, ['http://', 'https://'])) {
$url = ltrim(rtrim($this->baseUrl, '/').'/'.ltrim($url, '/'), '/');
}
$url = $this->expandUrlParameters($url);
<?php public function hashName($path = null)
{
if ($path) {
$path = rtrim($path, '/').'/';
}
$hash = $this->hashName ?: $this->hashName = Str::random(40);
<?php return collect($options)
->map(fn ($value, $key) => is_int($key) ? $value : "{$key}={$value}")
->map(fn ($value) => Str::finish($value, ';'))
->pipe(fn ($options) => rtrim(static::class.':'.$options->implode(''), ';'));
}
<?php protected function parseOptions($options)
{
return collect(explode(';', rtrim($options, ';')))->mapWithKeys(function ($option) {
$data = explode('=', $option, 2);
return [$data[0] => $data[1] ?? true];
<?php public function root()
{
return rtrim($this->getSchemeAndHttpHost().$this->getBaseUrl(), '/');
}
<?php public function url()
{
return rtrim(preg_replace('/\?.*/', '', $this->getUri()), '/');
}
<?php $this->perPage = (int) $perPage;
$this->cursor = $cursor;
$this->path = $this->path !== '/' ? rtrim($this->path, '/') : $this->path;
$this->setItems($items);
}