當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ArrayObject::natcasesort方法代碼示例

本文整理匯總了PHP中ArrayObject::natcasesort方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArrayObject::natcasesort方法的具體用法?PHP ArrayObject::natcasesort怎麽用?PHP ArrayObject::natcasesort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ArrayObject的用法示例。


在下文中一共展示了ArrayObject::natcasesort方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

<?php

$array = array('koala', 'kangaroo', 'wombat', 'wallaby', 'emu', 'kiwi', 'kookaburra', 'platypus');
/*** create the array object ***/
$arrayObj = new ArrayObject($array);
/*append a new value in the array*/
$arrayObj->append('dingo');
/*Sort a arrayobject */
$arrayObj->natcasesort();
/*Get the iterator obj*/
$iterator = $arrayObj->getIterator();
$arrayObj->offsetUnset(5);
if ($arrayObj->offsetExists(4)) {
    echo "Offset exitst" . "<br>";
}
/*Count the total array*/
echo "Total amount of " . $arrayObj->count() . "<br>";
/*Get traverse the whole the array*/
while ($iterator->valid()) {
    echo $iterator->key() . ' => ' . $iterator->current() . '<br />';
    $iterator->next();
}
開發者ID:AtiqulHaque,項目名稱:phprightway,代碼行數:22,代碼來源:SortArrayObject.php

示例2: array

<?php

//重點是演示ArrayObject中的natcasesort()方法
$array = array('koala', 'kangaroo', 'wombat', 'wallaby', 'emu', 'kiwi', 'kookaburra', 'platypeus');
$array_obj = new ArrayObject($array);
$array_obj->natcasesort();
for ($iterator = $array_obj->getIterator(); $iterator->valid(); $iterator->next()) {
    echo $iterator->key(), "=>", $iterator->current(), "\n";
}
開發者ID:nmred,項目名稱:study_test,代碼行數:9,代碼來源:sw_array_object_natcasesort.php

示例3: natcasesort

 public function natcasesort()
 {
     $this->lazyLoadArray();
     parent::natcasesort();
 }
開發者ID:jinshana,項目名稱:kajonacms,代碼行數:5,代碼來源:class_orm_assignment_array.php

示例4: ArrayObject

<?php

/* Prototype  : int ArrayObject::natcasesort()
 * Description: proto int ArrayIterator::natcasesort()
 Sort the entries by values using case insensitive "natural order" algorithm. 
 * Source code: ext/spl/spl_array.c
 * Alias to functions: 
 */
echo "*** Testing ArrayObject::natcasesort() : basic functionality ***\n";
$ao1 = new ArrayObject(array('boo10', 'boo1', 'boo2', 'boo22', 'BOO5'));
$ao2 = new ArrayObject(array('a' => 'boo10', 'b' => 'boo1', 'c' => 'boo2', 'd' => 'boo22', 'e' => 'BOO5'));
var_dump($ao1->natcasesort());
var_dump($ao1);
var_dump($ao2->natcasesort('blah'));
var_dump($ao2);
?>
===DONE===
開發者ID:badlamer,項目名稱:hhvm,代碼行數:17,代碼來源:arrayObject_natcasesort_basic1.php

示例5: natcasesort

 /**
  * Implementation of ArrayObject::natcasesort().
  *
  * This method is a case insensitive version of ArrayObject::natsort.
  *
  * This method implements a sort algorithm that orders alphanumeric strings
  * in the way a human being would while maintaining key/value associations.
  * This is described as a "natural ordering".
  *
  * No value is returned.
  */
 public function natcasesort()
 {
     $this->arrayObject->natcasesort();
 }
開發者ID:pbull,項目名稱:acquia-platform-cloud-data-model,代碼行數:15,代碼來源:ArrayObjectImplementationMethods.php


注:本文中的ArrayObject::natcasesort方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。