示例#1
0
 public function testExtract()
 {
     $expected = array('a' => 'ai', 'b' => 'bi', 'd' => 'ai');
     $this->assertEquals($expected, Arr::extract($this->input, 'i'));
     $expected = array('b' => 'bk', 'd' => 'dk');
     $this->assertEquals($expected, Arr::extract($this->input, 'k'));
 }
示例#2
0
 /**
  * Create an array of child values specified by a key in a 2D array.
  * @param mixed $field
  * @return Arr
  */
 public function extract($key)
 {
     return new self(Arr::extract($this->data, $key));
 }