Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Pop the element off the end of array
<?php array_pop(array &$array): mixed
<?php public function popLastSegment($path)
{
$parts = explode('/', $path);
array_pop($parts);
return implode('/', $parts);
}
<?php public function parent($url)
{
$url_array = explode('/', $url);
array_pop($url_array);
$url = implode('/', $url_array);
<?php {
$blueprint = str_replace('/', '.', $blueprint);
$parts = explode('.', $blueprint);
$handle = array_pop($parts);
$namespace = implode('.', $parts);
$namespace = empty($namespace) ? null : $namespace;
<?php public function last($value, $params)
{
if (is_array($value)) {
return array_pop($value);
}
return Stringy::last($value, Arr::get($params, 0));
<?php break;
default:
$last = array_pop($list);
$sentence = join(', ', $list);
$sentence .= ($oxford_comma) ? ',' : '';
<?php $crumbs = collect($segments)->map(function () use (&$segments) {
$uri = URL::tidy(join('/', $segments));
array_pop($segments);
return $uri;
})->mapWithKeys(function ($uri) {
<?php array_pop($segments);
$segment_urls = [];
<?php $segment_urls = [];
for ($i = 1; $i <= $segment_count; $i++) {
$segment_urls[] = URL::tidy(join('/', $segments));
array_pop($segments);
}
$segments = collect($segment_urls);
<?php $contents = $parser->parseView($path, $contents, $data);
if (array_pop($this->injectExtractions) === false) {
$contents->withoutExtractions();
}
<?php public function find($blueprint): ?Blueprint
{
$parts = explode('.', $blueprint);
$handle = array_pop($parts);
$namespace = implode('.', $parts);
$namespace = empty($namespace) ? '*' : $namespace;