Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Join array elements with a string
implode(string $separator, array $array): string
$classDirnameSegments = explode('\\', $classDirname);
return Arr::wrap(Collection::times(count($classDirnameSegments), function ($index) use ($class, $classDirnameSegments) {
$classDirname = implode('\\', array_slice($classDirnameSegments, 0, $index));
return $classDirname.'\\Policies\\'.class_basename($class).'Policy';
})->reverse()->values()->first(function ($class) {
return Arr::wrap(Collection::times(count($classDirnameSegments), function ($index) use ($class, $classDirnameSegments) {
$classDirname = implode('\\', array_slice($classDirnameSegments, 0, $index));
return $classDirname.'\\Policies\\'.class_basename($class).'Policy';
})->reverse()->values()->first(function ($class) {
public function broadcast(array $channels, $event, array $payload = [])
{
$channels = implode(', ', $this->formatChannels($channels));
$payload = json_encode($payload, JSON_PRETTY_PRINT);
{
$channels = implode(', ', $this->formatChannels($channels));
$payload = json_encode($payload, JSON_PRETTY_PRINT);
{
$parts = array_slice(str_split($hash = sha1($key), 2), 0, 2);
return $this->directory.'/'.implode('/', $parts).'/'.$hash;
}
$parts = array_slice(str_split($hash = sha1($key), 2), 0, 2);
return $this->directory.'/'.implode('/', $parts).'/'.$hash;
}
public function getNamespace()
{
return implode('|', $this->tagIds());
}
{
return implode('|', $this->tagIds());
}
public static function join($array, $glue, $finalGlue = '')
{
if ($finalGlue === '') {
return implode($glue, $array);
}
if (count($array) === 0) {
{
if ($finalGlue === '') {
return implode($glue, $array);
}
if (count($array) === 0) {
$finalItem = array_pop($array);
return implode($glue, $array).$finalGlue.$finalItem;
}
return implode($glue, $array).$finalGlue.$finalItem;
}
}
}
return implode(' ', $classes);
}
}
return implode(' ', $classes);
}
public function implode($value, $glue = null)
{
if ($this->useAsCallable($value)) {
return implode($glue ?? '', $this->map($value)->all());
}
$first = $this->first();
{
if ($this->useAsCallable($value)) {
return implode($glue ?? '', $this->map($value)->all());
}
$first = $this->first();
$first = $this->first();
if (is_array($first) || (is_object($first) && ! $first instanceof Stringable)) {
return implode($glue ?? '', $this->pluck($value)->all());
}
return implode($value ?? '', $this->items);
if (is_array($first) || (is_object($first) && ! $first instanceof Stringable)) {
return implode($glue ?? '', $this->pluck($value)->all());
}
return implode($value ?? '', $this->items);
return implode($glue ?? '', $this->pluck($value)->all());
}
return implode($value ?? '', $this->items);
}
}
return implode($value ?? '', $this->items);
}
protected function getNamespace($name)
{
return trim(implode('\\', array_slice(explode('\\', $name), 0, -1)), '\\');
}
{
return trim(implode('\\', array_slice(explode('\\', $name), 0, -1)), '\\');
}
sort($imports);
return str_replace(trim($match['imports']), implode("\n", $imports), $stub);
}
return $stub;
return str_replace(trim($match['imports']), implode("\n", $imports), $stub);
}
return $stub;
public function hourlyAt($offset)
{
$offset = is_array($offset) ? implode(',', $offset) : $offset;
return $this->spliceIntoPosition(1, $offset);
}
{
$offset = is_array($offset) ? implode(',', $offset) : $offset;
return $this->spliceIntoPosition(1, $offset);
}
{
$days = is_array($days) ? $days : func_get_args();
return $this->spliceIntoPosition(5, implode(',', $days));
}
$days = is_array($days) ? $days : func_get_args();
return $this->spliceIntoPosition(5, implode(',', $days));
}
$segments[$position - 1] = $value;
return $this->cron(implode(' ', $segments));
}
}
return $this->cron(implode(' ', $segments));
}
}