• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP natcasesort函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中natcasesort函数的典型用法代码示例。如果您正苦于以下问题:PHP natcasesort函数的具体用法?PHP natcasesort怎么用?PHP natcasesort使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了natcasesort函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getUpgrades

 /**
  * Returns an array of all possible upgrade files as an array with
  * the upgrade's key and version
  * 
  * This first looks for all .php files in the versions directory.
  * The files should have the format of VERSION_NUMBER (e.g. 1.0.0__1).
  * The project is then checked to see if 
  */
 public function getUpgrades()
 {
     if (!$this->_upgrades) {
         $this->_upgrades = array();
         $versions = array();
         $dir = dirname(__FILE__) . '/versions';
         $files = sfFinder::type('file')->name('*.php')->in($dir);
         foreach ($files as $file) {
             $info = pathinfo($file);
             if (strpos($info['filename'], '__') === false) {
                 throw new sfException(sprintf('Invalid upgrade filename format for file "%s" - must contain a double underscore - VERSION__NUMBER (e.g. 1.0.0__1) ', $info['filename']));
             }
             $e = explode('__', $info['filename']);
             $version = $e[0];
             $number = $e[1];
             if ($this->_isVersionNew($info['filename'])) {
                 $versions[] = array('version' => $version, 'number' => $number);
                 $this->_upgrades[] = $version . '__' . $number;
             }
         }
         natcasesort($this->_upgrades);
         foreach ($this->_upgrades as $key => $version) {
             $this->_upgrades[$key] = $versions[$key];
         }
     }
     return $this->_upgrades;
 }
开发者ID:sympal,项目名称:sympal,代码行数:35,代码来源:sfSympalProjectUpgrade.class.php


示例2: fileTree

 /**
  * 
  * @return string
  */
 public static function fileTree()
 {
     $root = JchPlatformPaths::rootPath();
     $dir = urldecode(JchPlatformUtility::get('dir', '', 'string', 'post'));
     $dir = JchPlatformUtility::decrypt($dir);
     $response = '';
     if (file_exists($root . $dir)) {
         $files = scandir($root . $dir);
         natcasesort($files);
         if (count($files) > 2) {
             /* The 2 accounts for . and .. */
             $response .= '<ul class="jqueryFileTree" style="display: none; ">';
             // All dirs
             foreach ($files as $file) {
                 if (file_exists($root . $dir . $file) && $file != '.' && $file != '..' && is_dir($root . $dir . $file)) {
                     $response .= '<li class="directory collapsed"><a href="#" rel="' . JchPlatformUtility::encrypt($dir . $file . '/') . '">' . htmlentities($file) . '</a></li>';
                 }
             }
             // All files
             foreach ($files as $file) {
                 if (file_exists($root . $dir . $file) && $file != '.' && $file != '..' && !is_dir($root . $dir . $file)) {
                     $ext = preg_replace('/^.*\\./', '', $file);
                     $response .= '<li class="file ext_' . $ext . '"><a href="#" rel="' . JchPlatformUtility::encrypt($dir . $file) . '">' . htmlentities($file) . '</a></li>';
                 }
             }
             $response .= '</ul>';
         }
     }
     return $response;
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:34,代码来源:ajax.php


示例3: doParsing

 /**
  * Do the parsing of the yaml files and return the final parsed array
  *
  * @return array $array
  */
 public function doParsing()
 {
     $recursiveMerge = Doctrine_Manager::getInstance()->getAttribute(Doctrine_Core::ATTR_RECURSIVE_MERGE_FIXTURES);
     $mergeFunction = $recursiveMerge === true ? 'array_merge_recursive' : 'array_merge';
     $directory = $this->getDirectory();
     $array = array();
     if ($directory !== null) {
         foreach ((array) $directory as $dir) {
             $e = explode('.', $dir);
             // If they specified a specific yml file
             if (end($e) == 'yml') {
                 $array = $mergeFunction($array, Doctrine_Parser::load($dir, $this->getFormat()));
                 // If they specified a directory
             } else {
                 if (is_dir($dir)) {
                     $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::LEAVES_ONLY);
                     $filesOrdered = array();
                     foreach ($it as $file) {
                         $filesOrdered[] = $file;
                     }
                     // force correct order
                     natcasesort($filesOrdered);
                     foreach ($filesOrdered as $file) {
                         $e = explode('.', $file->getFileName());
                         if (in_array(end($e), $this->getFormats())) {
                             $array = $mergeFunction($array, Doctrine_Parser::load($file->getPathName(), $this->getFormat()));
                         }
                     }
                 }
             }
         }
     }
     return $array;
 }
开发者ID:sensorsix,项目名称:app,代码行数:39,代码来源:Import.php


示例4: getTaxaFilterList

 public function getTaxaFilterList()
 {
     $returnArr = array();
     $sql = "SELECT DISTINCT nt.UnitName1, ts.Family ";
     if ($this->clid && $this->clType == "static") {
         $sql .= "FROM (taxstatus ts INNER JOIN taxa nt ON ts.tid = nt.tid) INNER JOIN fmchklsttaxalink cltl ON nt.TID = cltl.TID " . "WHERE (cltl.CLID = " . $this->clid . ") ";
     } else {
         if ($this->dynClid) {
             $sql .= "FROM (taxstatus ts INNER JOIN taxa nt ON ts.tid = nt.tid) INNER JOIN fmdyncltaxalink dcltl ON nt.TID = dcltl.TID " . "WHERE (dcltl.dynclid = " . $this->dynClid . ") ";
         } else {
             $sql .= "FROM (((taxstatus ts INNER JOIN taxa nt ON ts.tid = nt.tid) " . "INNER JOIN fmchklsttaxalink cltl ON nt.TID = cltl.TID) " . "INNER JOIN fmchecklists cl ON cltl.CLID = cl.CLID) " . "INNER JOIN fmchklstprojlink clpl ON cl.CLID = clpl.clid " . "WHERE (clpl.pid = " . $this->pid . ") ";
         }
     }
     $sql .= 'AND (ts.taxauthid = 1)';
     //echo $sql.'<br/>'; exit;
     $result = $this->keyCon->query($sql);
     while ($row = $result->fetch_object()) {
         $genus = $row->UnitName1;
         $family = $row->Family;
         if ($genus) {
             $returnArr[] = $genus;
         }
         if ($family) {
             $returnArr[] = $family;
         }
     }
     $result->free();
     $returnArr = array_unique($returnArr);
     natcasesort($returnArr);
     array_unshift($returnArr, "--------------------------");
     array_unshift($returnArr, "All Species");
     return $returnArr;
 }
开发者ID:Symbiota,项目名称:Symbiota,代码行数:33,代码来源:KeyDataManager.php


示例5: getRootDirContent

 public function getRootDirContent()
 {
     $path = PHPFOX_DIR;
     if (file_exists($path)) {
         if (is_dir($path)) {
             $this->files = scandir($path);
             //folders
             natcasesort($this->files);
             //All dirs
             foreach ($this->files as $file) {
                 if (file_exists($path . $file) && $file != '.' && $file != '..' && is_dir($path . $file)) {
                     $full_path = htmlentities($path . $file) . "/";
                     $this->filesforzip[] = str_replace('\\', '/', realpath($full_path) . "/");
                     $file = htmlentities($file);
                 }
             }
             foreach ($this->files as $file) {
                 if (file_exists($path . $file) && $file != '.' && $file != '..' && !is_dir($path . $file)) {
                     $full_path = htmlentities($path . $file);
                     $this->filesforzip[] = str_replace('\\', '/', realpath($full_path));
                     $file = htmlentities($file);
                 }
             }
         } else {
             $this->filesforzip[] = $path;
             //files
         }
     }
     //convert to string
     $comma_separated = implode(",", $this->filesforzip);
     //add taken content to db
     Phpfox::getService('backuprestore.backuprestore')->addBTDBSetting('included_paths', serialize($comma_separated));
 }
开发者ID:googlesky,项目名称:snsp.vn,代码行数:33,代码来源:jqueryFileTree.php


示例6: compo_cloud

function compo_cloud()
{
    global $wpdb;
    $topurl = get_bloginfo("url");
    $start = 10;
    $total = 24;
    $query = "SELECT {$wpdb->terms}.term_id, {$wpdb->terms}.name, {$wpdb->term_taxonomy}.count, {$wpdb->terms}.slug FROM (({$wpdb->term_relationships} INNER JOIN {$wpdb->posts} ON {$wpdb->term_relationships}.object_id = {$wpdb->posts}.ID) INNER JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_relationships}.term_taxonomy_id = {$wpdb->term_taxonomy}.term_taxonomy_id) INNER JOIN {$wpdb->terms} ON {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id WHERE ((({$wpdb->term_taxonomy}.taxonomy)='post_tag') AND (({$wpdb->posts}.post_status)='publish')) GROUP BY {$wpdb->terms}.name ORDER BY count DESC, {$wpdb->terms}.name";
    # LIMIT $start,$total";
    $terms = $wpdb->get_results($query);
    shuffle($terms);
    $data = array();
    foreach ($terms as $e) {
        if ($e->count < 2) {
            continue;
        }
        $data[] = "{$e->count}|{$e->name}|{$e->slug}";
        if (count($data) >= $total) {
            break;
        }
    }
    natcasesort($data);
    $out = array();
    $n = 0;
    foreach ($data as $v) {
        $z = intval(8 + $n * 0.5);
        list($x, $name, $slug) = explode("|", $v);
        //         $name = htmlentities($name);
        $out[] = "<a href='{$topurl}/tag/{$slug}' style='font-size:{$z}px'>{$name}</a>";
        $n += 1;
    }
    shuffle($out);
    echo implode(" ", $out);
}
开发者ID:philhassey,项目名称:ludumdare,代码行数:33,代码来源:cloud.php


示例7: listFiles

function listFiles($dir)
{
    global $cfg;
    $list = array();
    $full = $cfg['root'] . trim($dir, '/\\') . DIR_SEP;
    $thumb = $cfg['root'] . $cfg['thumb']['dir'] . DIR_SEP . trim($dir, '/\\') . DIR_SEP;
    $files = scandir($full);
    natcasesort($files);
    for ($i = -1, $iCount = count($files); ++$i < $iCount;) {
        $ext = substr($files[$i], strrpos($files[$i], '.') + 1);
        if (!in_array($files[$i], $cfg['hide']['file']) && !in_array($ext, $cfg['deny'][$cfg['type']]) && in_array($ext, $cfg['allow'][$cfg['type']]) && is_file($full . $files[$i])) {
            $imgSize = array(0, 0);
            if (in_array($ext, $cfg['allow']['image'])) {
                if ($cfg['thumb']['auto'] && !file_exists($thumb . $files[$i])) {
                    create_thumbnail($full . $files[$i], $thumb . $files[$i]);
                }
                $imgSize = getimagesize($full . $files[$i]);
            }
            $stats = getSize($full . $files[$i]);
            $list[] = array('name' => $files[$i], 'ext' => $ext, 'width' => $imgSize[0], 'height' => $imgSize[1], 'size' => $stats['_size'], 'date' => date($cfg['thumb']['date'], $stats['mtime']), 'r_size' => $stats['size'], 'mtime' => $stats['mtime'], 'thumb' => '/' . $cfg['url'] . '/' . $cfg['thumb']['dir'] . '/' . $dir . $files[$i]);
        }
    }
    switch ($cfg['sort']) {
        case 'size':
            usort($list, 'sortSize');
            break;
        case 'date':
            usort($list, 'sortDate');
            break;
        default:
            //name
            break;
    }
    return $list;
}
开发者ID:jfkz,项目名称:aquarel-cms,代码行数:35,代码来源:cfg.php


示例8: getImagesFromFolder

 static function getImagesFromFolder(&$params)
 {
     if (!is_numeric($max = $params->get('max_images'))) {
         $max = 20;
     }
     $folder = $params->get('image_folder');
     if (!($dir = @opendir($folder))) {
         return null;
     }
     while (false !== ($file = readdir($dir))) {
         if (preg_match('/.+\\.(jpg|jpeg|gif|png)$/i', $file)) {
             // check with getimagesize() which attempts to return the image mime-type
             if (getimagesize(JPATH_ROOT . DS . $folder . DS . $file) !== FALSE) {
                 $files[] = $file;
             }
         }
     }
     closedir($dir);
     if ($params->get('sort_by')) {
         natcasesort($files);
     } else {
         shuffle($files);
     }
     $images = array_slice($files, 0, $max);
     $target = modDJImageSliderHelper::getSlideTarget($params->get('link'));
     foreach ($images as $image) {
         $slides[] = (object) array('title' => '', 'description' => '', 'image' => $folder . '/' . $image, 'link' => $params->get('link'), 'alt' => $image, 'target' => $target);
     }
     return $slides;
 }
开发者ID:arg2016,项目名称:innovacion,代码行数:30,代码来源:helper.php


示例9: wikiplugin_sort

function wikiplugin_sort($data, $params)
{
    global $tikilib;
    extract($params, EXTR_SKIP);
    $sort = isset($sort) ? $sort : "asc";
    $lines = preg_split("/\n+/", $data, -1, PREG_SPLIT_NO_EMPTY);
    // separate lines into array
    // $lines = array_filter( $lines, "chop" ); // remove \n
    srand((double) microtime() * 1000000);
    // needed for shuffle;
    if ($sort == "asc") {
        natcasesort($lines);
    } else {
        if ($sort == "desc") {
            natcasesort($lines);
            $lines = array_reverse($lines);
        } else {
            if ($sort == "reverse") {
                $lines = array_reverse($lines);
            } else {
                if ($sort == "shuffle") {
                    shuffle($lines);
                }
            }
        }
    }
    reset($lines);
    if (is_array($lines)) {
        $data = implode("\n", $lines);
    }
    $data = trim($data);
    return $data;
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:33,代码来源:wikiplugin_sort.php


示例10: render

 public function render()
 {
     $conpherence = $this->getConpherence();
     $widget_data = $conpherence->getWidgetData();
     $viewer = $this->getUser();
     $participants = $conpherence->getParticipants();
     $handles = $conpherence->getHandles();
     $head_handles = array_select_keys($handles, array($viewer->getPHID()));
     $handle_list = mpull($handles, 'getName');
     natcasesort($handle_list);
     $handles = mpull($handles, null, 'getName');
     $handles = array_select_keys($handles, $handle_list);
     $head_handles = mpull($head_handles, null, 'getName');
     $handles = $head_handles + $handles;
     $can_edit = PhabricatorPolicyFilter::hasCapability($viewer, $conpherence, PhabricatorPolicyCapability::CAN_EDIT);
     $body = array();
     foreach ($handles as $handle) {
         $user_phid = $handle->getPHID();
         if ($user_phid == $viewer->getPHID() || $can_edit) {
             $icon = id(new PHUIIconView())->setIcon('fa-times lightbluetext');
             $remove_html = javelin_tag('a', array('class' => 'remove', 'sigil' => 'remove-person', 'meta' => array('remove_person' => $user_phid, 'action' => 'remove_person')), $icon);
         } else {
             $remove_html = null;
         }
         $body[] = phutil_tag('div', array('class' => 'person-entry grouped'), array(phutil_tag('a', array('class' => 'pic', 'href' => $handle->getURI()), phutil_tag('img', array('src' => $handle->getImageURI()), '')), $handle->renderLink(), $remove_html));
     }
     return $body;
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:28,代码来源:ConpherencePeopleWidgetView.php


示例11: generatePage

 public static function generatePage(&$tpl, &$session, &$account, &$mj)
 {
     if (!isset($_POST['db_id']) && isset($_GET['id'])) {
         $_POST['db_id'] = $_GET['id'];
     }
     if (!isset($_POST['db_id'])) {
         return fctErrorMSG('Vous devez sélectionner un objet.');
     }
     $dbMgr = DbManager::getInstance();
     //Instancier le gestionnaire
     $db = $dbMgr->getConn('game');
     //Demander la connexion existante
     if (isset($_POST['save'])) {
         self::save();
         die("<script>location.href='?mj=Item_Livre';</script>");
     }
     $tpl->set('ACTIONTYPETXT', "Modifier");
     $tpl->set('SUBMITNAME', 'Mod');
     $tpl->set('SHOWID', true);
     $query = 'SELECT `db_id`,' . ' `db_nom`,' . ' `db_desc`,' . ' `db_pass`,' . ' `db_img`,' . ' `db_pr`,' . ' `db_param`,' . ' `db_valeur`,' . ' `db_resistance`,' . ' `db_notemj`' . ' FROM  `' . DB_PREFIX . 'item_db`' . ' WHERE `db_id` = :db_id;';
     $prep = $db->prepare($query);
     $prep->bindValue(':db_id', $_POST['db_id'], PDO::PARAM_INT);
     $prep->execute($db, __FILE__, __LINE__);
     $arr = $prep->fetch();
     $prep->closeCursor();
     $prep = NULL;
     $tpl->set('ITEM', $arr);
     //lister le dossier d'image
     $dir2 = dir($account->getSkinRemotePhysicalPath() . "../_common/items/");
     $counter = 0;
     $arrurl = array();
     $arr = array();
     while ($url = $dir2->read()) {
         $arrurl[$counter++] = $url;
     }
     natcasesort($arrurl);
     $arrurl = array_values($arrurl);
     for ($i = 0; $i < count($arrurl); $i++) {
         if ($arrurl[$i] != '' && substr($arrurl[$i], 0, 1) != '.') {
             $arr[$i] = $arrurl[$i];
         }
     }
     $tpl->set('IMGS', $arr);
     //Générer la liste des actions associable à un lieu
     $query = 'SELECT `id`, `url`, `caption`' . ' FROM `' . DB_PREFIX . 'item_menu`' . ' WHERE `item_dbid` = :db_id;';
     $prep = $db->prepare($query);
     $prep->bindValue(':db_id', $_POST['db_id'], PDO::PARAM_INT);
     $prep->execute($db, __FILE__, __LINE__);
     $result = $prep->fetchAll();
     $prep->closeCursor();
     $prep = NULL;
     if (count($result) > 0) {
         $ACTIONS = array();
         foreach ($result as $arr) {
             $ACTIONS[] = $arr;
         }
         $tpl->set('ACTIONS', $ACTIONS);
     }
     return $tpl->fetch($account->getSkinRemotePhysicalPath() . 'html/Mj/Item/Livre_Addmod.htm');
 }
开发者ID:BalamWeb,项目名称:ccv4,代码行数:60,代码来源:LivreMod.php


示例12: _loadTerms

 /**
  * Load terms and try to sort it by names
  *
  * @return $this
  */
 protected function _loadTerms()
 {
     if (empty($this->_terms)) {
         $this->_terms = [];
         $terms = $this->_queryCollectionFactory->create()->setPopularQueryFilter($this->_storeManager->getStore()->getId())->setPageSize(100)->load()->getItems();
         if (count($terms) == 0) {
             return $this;
         }
         $this->_maxPopularity = reset($terms)->getPopularity();
         $this->_minPopularity = end($terms)->getPopularity();
         $range = $this->_maxPopularity - $this->_minPopularity;
         $range = $range == 0 ? 1 : $range;
         foreach ($terms as $term) {
             if (!$term->getPopularity()) {
                 continue;
             }
             $term->setRatio(($term->getPopularity() - $this->_minPopularity) / $range);
             $temp[$term->getName()] = $term;
             $termKeys[] = $term->getName();
         }
         natcasesort($termKeys);
         foreach ($termKeys as $termKey) {
             $this->_terms[$termKey] = $temp[$termKey];
         }
     }
     return $this;
 }
开发者ID:tingyeeh,项目名称:magento2,代码行数:32,代码来源:Term.php


示例13: filelist

 public function filelist()
 {
     $mp3s = $directories = $current = array();
     if (!empty($_GET['dir'])) {
         $currentDir = urldecode($_GET['dir']);
     } else {
         $currentDir = '';
     }
     $contents = mpc::ls($currentDir);
     natcasesort($contents);
     foreach ($contents as $value) {
         if (strpos($value, '/') > 0) {
             $value = substr($value, strrpos($value, '/') + 1);
         }
         if (strtolower(substr($value, -4)) == ".mp3") {
             $mp3s[] = $value;
         } else {
             $directories[$value] = $currentDir . '/' . $value;
         }
     }
     if (!empty($currentDir)) {
         $directories = array('up' => substr($currentDir, 0, strrpos($currentDir, '/'))) + $directories;
     }
     return array('files' => $mp3s, 'directories' => $directories, 'currentDir' => $currentDir);
 }
开发者ID:romiro,项目名称:cupcake,代码行数:25,代码来源:ElementController.php


示例14: getStandardList

 /**
  * Get an array of all two-letter country code => country name pairs.
  *
  * @return array
  *   An array of country code => country name pairs.
  */
 public static function getStandardList()
 {
     $countries = array('AC' => t('Ascension Island'), 'AD' => t('Andorra'), 'AE' => t('United Arab Emirates'), 'AF' => t('Afghanistan'), 'AG' => t('Antigua and Barbuda'), 'AI' => t('Anguilla'), 'AL' => t('Albania'), 'AM' => t('Armenia'), 'AN' => t('Netherlands Antilles'), 'AO' => t('Angola'), 'AQ' => t('Antarctica'), 'AR' => t('Argentina'), 'AS' => t('American Samoa'), 'AT' => t('Austria'), 'AU' => t('Australia'), 'AW' => t('Aruba'), 'AX' => t('Åland Islands'), 'AZ' => t('Azerbaijan'), 'BA' => t('Bosnia and Herzegovina'), 'BB' => t('Barbados'), 'BD' => t('Bangladesh'), 'BE' => t('Belgium'), 'BF' => t('Burkina Faso'), 'BG' => t('Bulgaria'), 'BH' => t('Bahrain'), 'BI' => t('Burundi'), 'BJ' => t('Benin'), 'BL' => t('Saint Barthélemy'), 'BM' => t('Bermuda'), 'BN' => t('Brunei'), 'BO' => t('Bolivia'), 'BQ' => t('Caribbean Netherlands'), 'BR' => t('Brazil'), 'BS' => t('Bahamas'), 'BT' => t('Bhutan'), 'BV' => t('Bouvet Island'), 'BW' => t('Botswana'), 'BY' => t('Belarus'), 'BZ' => t('Belize'), 'CA' => t('Canada'), 'CC' => t('Cocos [Keeling] Islands'), 'CD' => t('Congo - Kinshasa'), 'CF' => t('Central African Republic'), 'CG' => t('Congo - Brazzaville'), 'CH' => t('Switzerland'), 'CI' => t('Côte d’Ivoire'), 'CK' => t('Cook Islands'), 'CL' => t('Chile'), 'CM' => t('Cameroon'), 'CN' => t('China'), 'CO' => t('Colombia'), 'CP' => t('Clipperton Island'), 'CR' => t('Costa Rica'), 'CU' => t('Cuba'), 'CV' => t('Cape Verde'), 'CW' => t('Curaçao'), 'CX' => t('Christmas Island'), 'CY' => t('Cyprus'), 'CZ' => t('Czech Republic'), 'DE' => t('Germany'), 'DG' => t('Diego Garcia'), 'DJ' => t('Djibouti'), 'DK' => t('Denmark'), 'DM' => t('Dominica'), 'DO' => t('Dominican Republic'), 'DZ' => t('Algeria'), 'EA' => t('Ceuta and Melilla'), 'EC' => t('Ecuador'), 'EE' => t('Estonia'), 'EG' => t('Egypt'), 'EH' => t('Western Sahara'), 'ER' => t('Eritrea'), 'ES' => t('Spain'), 'ET' => t('Ethiopia'), 'FI' => t('Finland'), 'FJ' => t('Fiji'), 'FK' => t('Falkland Islands'), 'FM' => t('Micronesia'), 'FO' => t('Faroe Islands'), 'FR' => t('France'), 'GA' => t('Gabon'), 'GB' => t('United Kingdom'), 'GD' => t('Grenada'), 'GE' => t('Georgia'), 'GF' => t('French Guiana'), 'GG' => t('Guernsey'), 'GH' => t('Ghana'), 'GI' => t('Gibraltar'), 'GL' => t('Greenland'), 'GM' => t('Gambia'), 'GN' => t('Guinea'), 'GP' => t('Guadeloupe'), 'GQ' => t('Equatorial Guinea'), 'GR' => t('Greece'), 'GS' => t('South Georgia and the South Sandwich Islands'), 'GT' => t('Guatemala'), 'GU' => t('Guam'), 'GW' => t('Guinea-Bissau'), 'GY' => t('Guyana'), 'HK' => t('Hong Kong SAR China'), 'HM' => t('Heard Island and McDonald Islands'), 'HN' => t('Honduras'), 'HR' => t('Croatia'), 'HT' => t('Haiti'), 'HU' => t('Hungary'), 'IC' => t('Canary Islands'), 'ID' => t('Indonesia'), 'IE' => t('Ireland'), 'IL' => t('Israel'), 'IM' => t('Isle of Man'), 'IN' => t('India'), 'IO' => t('British Indian Ocean Territory'), 'IQ' => t('Iraq'), 'IR' => t('Iran'), 'IS' => t('Iceland'), 'IT' => t('Italy'), 'JE' => t('Jersey'), 'JM' => t('Jamaica'), 'JO' => t('Jordan'), 'JP' => t('Japan'), 'KE' => t('Kenya'), 'KG' => t('Kyrgyzstan'), 'KH' => t('Cambodia'), 'KI' => t('Kiribati'), 'KM' => t('Comoros'), 'KN' => t('Saint Kitts and Nevis'), 'KP' => t('North Korea'), 'KR' => t('South Korea'), 'KW' => t('Kuwait'), 'KY' => t('Cayman Islands'), 'KZ' => t('Kazakhstan'), 'LA' => t('Laos'), 'LB' => t('Lebanon'), 'LC' => t('Saint Lucia'), 'LI' => t('Liechtenstein'), 'LK' => t('Sri Lanka'), 'LR' => t('Liberia'), 'LS' => t('Lesotho'), 'LT' => t('Lithuania'), 'LU' => t('Luxembourg'), 'LV' => t('Latvia'), 'LY' => t('Libya'), 'MA' => t('Morocco'), 'MC' => t('Monaco'), 'MD' => t('Moldova'), 'ME' => t('Montenegro'), 'MF' => t('Saint Martin'), 'MG' => t('Madagascar'), 'MH' => t('Marshall Islands'), 'MK' => t('Macedonia'), 'ML' => t('Mali'), 'MM' => t('Myanmar [Burma]'), 'MN' => t('Mongolia'), 'MO' => t('Macau SAR China'), 'MP' => t('Northern Mariana Islands'), 'MQ' => t('Martinique'), 'MR' => t('Mauritania'), 'MS' => t('Montserrat'), 'MT' => t('Malta'), 'MU' => t('Mauritius'), 'MV' => t('Maldives'), 'MW' => t('Malawi'), 'MX' => t('Mexico'), 'MY' => t('Malaysia'), 'MZ' => t('Mozambique'), 'NA' => t('Namibia'), 'NC' => t('New Caledonia'), 'NE' => t('Niger'), 'NF' => t('Norfolk Island'), 'NG' => t('Nigeria'), 'NI' => t('Nicaragua'), 'NL' => t('Netherlands'), 'NO' => t('Norway'), 'NP' => t('Nepal'), 'NR' => t('Nauru'), 'NU' => t('Niue'), 'NZ' => t('New Zealand'), 'OM' => t('Oman'), 'PA' => t('Panama'), 'PE' => t('Peru'), 'PF' => t('French Polynesia'), 'PG' => t('Papua New Guinea'), 'PH' => t('Philippines'), 'PK' => t('Pakistan'), 'PL' => t('Poland'), 'PM' => t('Saint Pierre and Miquelon'), 'PN' => t('Pitcairn Islands'), 'PR' => t('Puerto Rico'), 'PS' => t('Palestinian Territories'), 'PT' => t('Portugal'), 'PW' => t('Palau'), 'PY' => t('Paraguay'), 'QA' => t('Qatar'), 'QO' => t('Outlying Oceania'), 'RE' => t('Réunion'), 'RO' => t('Romania'), 'RS' => t('Serbia'), 'RU' => t('Russia'), 'RW' => t('Rwanda'), 'SA' => t('Saudi Arabia'), 'SB' => t('Solomon Islands'), 'SC' => t('Seychelles'), 'SD' => t('Sudan'), 'SE' => t('Sweden'), 'SG' => t('Singapore'), 'SH' => t('Saint Helena'), 'SI' => t('Slovenia'), 'SJ' => t('Svalbard and Jan Mayen'), 'SK' => t('Slovakia'), 'SL' => t('Sierra Leone'), 'SM' => t('San Marino'), 'SN' => t('Senegal'), 'SO' => t('Somalia'), 'SR' => t('Suriname'), 'SS' => t('South Sudan'), 'ST' => t('São Tomé and Príncipe'), 'SV' => t('El Salvador'), 'SX' => t('Sint Maarten'), 'SY' => t('Syria'), 'SZ' => t('Swaziland'), 'TA' => t('Tristan da Cunha'), 'TC' => t('Turks and Caicos Islands'), 'TD' => t('Chad'), 'TF' => t('French Southern Territories'), 'TG' => t('Togo'), 'TH' => t('Thailand'), 'TJ' => t('Tajikistan'), 'TK' => t('Tokelau'), 'TL' => t('Timor-Leste'), 'TM' => t('Turkmenistan'), 'TN' => t('Tunisia'), 'TO' => t('Tonga'), 'TR' => t('Turkey'), 'TT' => t('Trinidad and Tobago'), 'TV' => t('Tuvalu'), 'TW' => t('Taiwan'), 'TZ' => t('Tanzania'), 'UA' => t('Ukraine'), 'UG' => t('Uganda'), 'UM' => t('U.S. Outlying Islands'), 'US' => t('United States'), 'UY' => t('Uruguay'), 'UZ' => t('Uzbekistan'), 'VA' => t('Vatican City'), 'VC' => t('Saint Vincent and the Grenadines'), 'VE' => t('Venezuela'), 'VG' => t('British Virgin Islands'), 'VI' => t('U.S. Virgin Islands'), 'VN' => t('Vietnam'), 'VU' => t('Vanuatu'), 'WF' => t('Wallis and Futuna'), 'WS' => t('Samoa'), 'XK' => t('Kosovo'), 'YE' => t('Yemen'), 'YT' => t('Mayotte'), 'ZA' => t('South Africa'), 'ZM' => t('Zambia'), 'ZW' => t('Zimbabwe'));
     // Sort the list.
     natcasesort($countries);
     return $countries;
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:13,代码来源:CountryManager.php


示例15: wpdm_odir_tree

function wpdm_odir_tree()
{
    if (!isset($_GET['task']) || $_GET['task'] != 'wpdm_odir_tree') {
        return;
    }
    if (!current_user_can('access_server_browser')) {
        echo "<ul><li>" . __('Not Allowed!', 'wpdmpro') . "</li></ul>";
        die;
    }
    $_POST['dir'] = isset($_POST['dir']) ? urldecode($_POST['dir']) : '';
    $root = '';
    if (file_exists($root . $_POST['dir'])) {
        $files = scandir($root . $_POST['dir']);
        natcasesort($files);
        if (count($files) > 2) {
            /* The 2 accounts for . and .. */
            echo "<ul class=\"jqueryFileTree\" style=\"display: none;\">";
            // All dirs
            foreach ($files as $file) {
                if (file_exists($root . $_POST['dir'] . $file) && $file != '.' && $file != '..' && is_dir($root . $_POST['dir'] . $file)) {
                    echo "<li class=\"directory collapsed\"><a onclick=\"odirpath(this)\" class=\"odir\" href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "/\">" . htmlentities($file) . "</a></li>";
                }
            }
            echo "</ul>";
        }
    }
    die;
}
开发者ID:bitflipper1,项目名称:ghcontracting,代码行数:28,代码来源:server-dir-browser.php


示例16: execute

 public function execute()
 {
     $path = rtrim(waRequest::post('path'), ' /');
     $path = wa()->getDataPath($path, true);
     if (!file_exists($path)) {
         throw new waException("File not found", 404);
     }
     $files = array();
     $dh = opendir($path);
     $names = array();
     while (($f = readdir($dh)) !== false) {
         if ($f !== '.' && $f !== '..' && is_file($path . '/' . $f)) {
             $t = filemtime($path . '/' . $f);
             $name = htmlspecialchars($f);
             $files[$name] = array('file' => $name, 'type' => $this->getType($f), 'size' => filesize($path . '/' . $f), 'timestamp' => $t, 'datetime' => waDateTime::format('humandatetime', $t));
             $names[] = $name;
         }
     }
     natcasesort($names);
     $sorted_files = array();
     foreach ($names as $name) {
         $sorted_files[] =& $files[$name];
     }
     closedir($dh);
     $this->response = $sorted_files;
 }
开发者ID:navi8602,项目名称:wa-shop-ppg,代码行数:26,代码来源:siteFilesList.controller.php


示例17: list_of_customers

 /**
  * returns an aray of customers
  * The unselect option shows an extra line, basically allowing you to deselect the
  * current option.
  *
  * @param Boolean $showUnselectedOption
  * @return Array ( ID => Email (member.title) )
  */
 public static function list_of_customers($showUnselectedOption = false)
 {
     //start array
     $array = array();
     if ($showUnselectedOption) {
         $array[0] = _t("Member.SELECTCUSTOMER", " --- SELECT CUSTOMER ---");
     }
     //get customer group
     $customerCode = EcommerceConfig::get("EcommerceRole", "customer_group_code");
     $group = Group::get()->Filter(array("Code" => $customerCode))->First();
     //fill array
     if ($group) {
         $members = $group->Members();
         $membersCount = $members->count();
         if ($membersCount > 0 && $membersCount < Config::inst()->get("EcommerceRole", "max_count_of_members_in_array")) {
             foreach ($members as $member) {
                 if ($member->Email) {
                     $array[$member->ID] = $member->Email . " (" . $member->getTitle() . ")";
                 }
             }
         } else {
             return $array;
         }
     }
     //sort in a natural order
     natcasesort($array);
     return $array;
 }
开发者ID:helpfulrobot,项目名称:sunnysideup-ecommerce,代码行数:36,代码来源:EcommerceRole.php


示例18: makePathfield

/**
 * Returns a valid html tag for the choosen $fieldType for pathes
 *
 * @param  string   path       The path to start searching in
 * @param  integer  uid        The uid which must match the found directories
 * @param  integer  gid        The gid which must match the found direcotries
 * @param  string   fieldType  Either "Manual" or "Dropdown"
 * @return string   The html tag for the choosen $fieldType
 *
 * @author Martin Burchert  <[email protected]>
 * @author Manuel Bernhardt <[email protected]>
 */
function makePathfield($path, $uid, $gid, $fieldType, $value = '')
{
    global $lng;
    $value = str_replace($path, '', $value);
    $field = '';
    if ($fieldType == 'Manual') {
        $field = '<input type="text" name="path" value="' . htmlspecialchars($value) . '" size="30" />';
    } elseif ($fieldType == 'Dropdown') {
        $dirList = findDirs($path, $uid, $gid);
        natcasesort($dirList);
        if (sizeof($dirList) > 0) {
            $field = '<select name="path">';
            foreach ($dirList as $key => $dir) {
                if (strpos($dir, $path) === 0) {
                    $dir = makeCorrectDir(substr($dir, strlen($path)));
                }
                $field .= makeoption($dir, $dir, $value);
            }
            $field .= '</select>';
        } else {
            $field = $lng['panel']['dirsmissing'];
            $field .= '<input type="hidden" name="path" value="/" />';
        }
    }
    return $field;
}
开发者ID:HobbyNToys,项目名称:SysCP,代码行数:38,代码来源:function.makePathfield.php


示例19: table_sort

 /**
  * 对查询结果集进行排序
  * @param array $array 查询结果
  * @param string $field 排序的字段名
  * @param string $sortby 排序类型  asc正向排序 desc逆向排序 nat自然排序
  * @return array
  */
 public function table_sort($array, $field, $sortby = 'asc')
 {
     if (!is_array($array)) {
         return $array;
     }
     $sort = $r = [];
     foreach ($array as $i => $data) {
         $sort[$i] =& $data[$field];
     }
     switch ($sortby) {
         case 'asc':
             // 正向排序
             asort($sort);
             break;
         case 'desc':
             // 逆向排序
             arsort($sort);
             break;
         case 'nat':
             // 自然排序
             natcasesort($sort);
             break;
     }
     foreach ($sort as $key => $val) {
         $r[] =& $array[$key];
     }
     return $r;
 }
开发者ID:urn2,项目名称:nx,代码行数:35,代码来源:table.php


示例20: __construct

 public function __construct($from, $name, array $config)
 {
     $this->name = $name;
     $this->model_from = $from;
     $this->model_to = array_key_exists('model_to', $config) ? $config['model_to'] : \Inflector::get_namespace($from) . 'Model_' . \Inflector::classify($name);
     $this->key_from = array_key_exists('key_from', $config) ? (array) $config['key_from'] : $this->key_from;
     $this->key_to = array_key_exists('key_to', $config) ? (array) $config['key_to'] : $this->key_to;
     $this->conditions = array_key_exists('conditions', $config) ? (array) $config['conditions'] : array();
     if (!empty($config['table_through'])) {
         $this->table_through = $config['table_through'];
     } else {
         $table_name = array($this->model_from, $this->model_to);
         natcasesort($table_name);
         $table_name = array_merge($table_name);
         $this->table_through = \Inflector::tableize($table_name[0]) . '_' . \Inflector::tableize($table_name[1]);
     }
     $this->key_through_from = !empty($config['key_through_from']) ? (array) $config['key_through_from'] : (array) \Inflector::foreign_key($this->model_from);
     $this->key_through_to = !empty($config['key_through_to']) ? (array) $config['key_through_to'] : (array) \Inflector::foreign_key($this->model_to);
     $this->cascade_save = array_key_exists('cascade_save', $config) ? $config['cascade_save'] : $this->cascade_save;
     $this->cascade_delete = array_key_exists('cascade_delete', $config) ? $config['cascade_delete'] : $this->cascade_delete;
     if (!class_exists($this->model_to)) {
         throw new \FuelException('Related model not found by Many_Many relation "' . $this->name . '": ' . $this->model_to);
     }
     $this->model_to = get_real_class($this->model_to);
 }
开发者ID:rickmellor,项目名称:Infrastructure,代码行数:25,代码来源:manymany.php



注:本文中的natcasesort函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP natsort函数代码示例发布时间:2022-05-15
下一篇:
PHP namespaceSplit函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap