natsort example

?> <div class="content" id="response"> <table> <tr> <td style="width: 15em">Response Status</td> <td><?= esc($response->getStatusCode() . ' - ' . $response->getReasonPhrase()) ?></td> </tr> </table> <?php $headers = $response->headers(); ?> <?php if (empty($headers)) : ?> <?php natsort($headers) ?> <h3>Headers</h3> <table> <thead> <tr> <th>Header</th> <th>Value</th> </tr> </thead> <tbody>
/** * Filters the different dimensions that a site icon is saved in. * * @since 4.3.0 * * @param int[] $site_icon_sizes Array of sizes available for the Site Icon. */
        $this->site_icon_sizes = apply_filters( 'site_icon_image_sizes', $this->site_icon_sizes );

        // Use a natural sort of numbers.         natsort( $this->site_icon_sizes );
        $this->site_icon_sizes = array_reverse( $this->site_icon_sizes );

        // Ensure that we only resize the image into sizes that allow cropping.         foreach ( $sizes as $name => $size_array ) {
            if ( isset( $size_array['crop'] ) ) {
                $only_crop_sizes[ $name ] = $size_array;
            }
        }

        foreach ( $this->site_icon_sizes as $size ) {
            if ( $size < $this->min_size ) {
                
foreach ($this->filesystem->listContents($dir) as $meta) {
            if ($meta->type() !== 'file'
                || $meta->path() === $target
                || !str_starts_with($meta->path()$partFilePrefix)) {
                continue;
            }

            $partFiles[] = $meta->path();
        }

        // sort by offset         natsort($partFiles);

        // concatenate all part files into a temporary file         foreach ($partFiles as $partFile) {
            $stream = $this->filesystem->readStream($partFile);
            if (stream_copy_to_stream($stream$tmp) === false) {
                throw ImportExportException::processingError('Failed to merge files');
            }
        }

        // copy final file into filesystem         $this->filesystem->writeStream($target$tmp);

        
$configuration = $this->getConfiguration();
    $entity_type_id = $configuration['target_type'];
    $entity_type = $this->entityTypeManager->getDefinition($entity_type_id);
    $bundles = $this->entityTypeBundleInfo->getBundleInfo($entity_type_id);

    if ($entity_type->hasKey('bundle')) {
      $bundle_options = [];
      foreach ($bundles as $bundle_name => $bundle_info) {
        $bundle_options[$bundle_name] = $bundle_info['label'];
      }
      natsort($bundle_options);
      $selected_bundles = array_intersect_key(
        $bundle_options,
        array_filter((array) $configuration['target_bundles'])
      );

      $form['target_bundles'] = [
        '#type' => 'checkboxes',
        '#title' => $entity_type->getBundleLabel(),
        '#options' => $bundle_options,
        '#default_value' => (array) $configuration['target_bundles'],
        '#required' => TRUE,
        
        }

        $struct['dirs'][] = $sPath = realpath($sPath); // XXX don't add if '.' or '..' ?         $list = array();
        while (false !== ($file = readdir($dir))) {
            if ($file != '.' && $file != '..') {
                $list[] = $file;
            }
        }

        closedir($dir);
        natsort($list);
        if ($aktinst < $maxinst || $maxinst == 0) {
            foreach ($list as $val) {
                $path = $sPath . DIRECTORY_SEPARATOR . $val;
                if (is_dir($path) && !is_link($path)) {
                    $tmp    = System::_dirToStruct($path$maxinst$aktinst+1, $silent);
                    $struct = array_merge_recursive($struct$tmp);
                } else {
                    $struct['files'][] = $path;
                }
            }
        }

        
Home | Imprint | This part of the site doesn't use cookies.