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         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);

    }