Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Sort an array by key in ascending order
<?php ksort(array &$array, int $flags = SORT_REGULAR): true
<?php $test = (bool) collect(data_get($this->effects, 'dispatches'))->first(function ($item) use ($value, $params) {
$commonParams = array_intersect_key($item['params'], $params);
ksort($commonParams);
ksort($params);
return $item['name'] === $value
<?php $commonParams = array_intersect_key($item['params'], $params);
ksort($commonParams);
ksort($params);
return $item['name'] === $value
&& $commonParams === $params;
<?php if (! array_is_list($array)) {
$descending
? krsort($array, $options)
: ksort($array, $options);
} else {
$descending
? rsort($array, $options)
<?php {
$items = $this->items;
$descending ? krsort($items, $options) : ksort($items, $options);
return new static($items);
}
<?php else {
foreach ($values as $key => $value) {
ksort($value);
$values[$key] = $value;
}
<?php $values = [$values];
} else {
foreach ($values as $key => $value) {
ksort($value);
$values[$key] = $value;
}
<?php $values = [$values];
} else {
foreach ($values as $key => $value) {
ksort($value);
$values[$key] = $value;
}
<?php $files[$directory.basename($file->getRealPath(), '.php')] = $file->getRealPath();
}
ksort($files, SORT_NATURAL);
return $files;
}
<?php $parameters = $parameters + ['expires' => $this->availableAt($expiration)];
}
ksort($parameters);
$key = call_user_func($this->keyResolver);
<?php protected function reorderAssocKeys(array $data)
{
$data = Arr::dot($data);
ksort($data);
$result = [];
<?php $this->ensureSorted($arg);
}
ksort($value);
}
<?php public function execute($params = null): ResultInterface
{
if ($params === null) {
ksort($this->bindParam);
$params = [];
<?php private function assertSameAfterSorting($expected, $actual, $message = '')
{
if (is_array($expected)) {
ksort($expected);
}
if (is_array($actual)) {
<?php }
if (is_array($actual)) {
ksort($actual);
}
$this->assertSame($expected, $actual, $message);
<?php $variables = $event->view->gatherData();
ksort($variables);
debugbar()->addCollector(new VariableCollector($variables, 'Variables'));
}