remove() 정적인 공개 메소드

Removes an element from an array
static public remove ( array $array, mixed $search, boolean $key = true ) : array
$array array The source array
$search mixed The value or key to look for
$key boolean Pass true to search for an key, pass false to search for an value.
리턴 array The result array without the removed element
예제 #1
0
파일: kirby.php 프로젝트: andywenk/kirby
 function remove($key)
 {
     return a::remove($_SESSION, $key);
 }
예제 #2
0
파일: kirby.php 프로젝트: sdvig/kirbycms
 /**
  * Removes a value from the session by key
  *
  * @param  mixed    $key The key to remove by
  * @return array    The session array without the value
  */
 static function remove($key)
 {
     if (!isset($_SESSION)) {
         return false;
     }
     $_SESSION = a::remove($_SESSION, $key, true);
     return $_SESSION;
 }
예제 #3
0
 function testArrayRemove()
 {
     $this->assertEqual(a::remove($this->arr, 'cat'), array('dog' => 'wuff', 'bird' => 'tweet'));
 }