update : 2015.11.03
php.shukuma.com

검색:
 
 
Returns the value at the specified index

ArrayObject::offsetGet

(PHP 5 >= 5.0.0)

ArrayObject::offsetGetReturns the value at the specified index

설명

public mixed ArrayObject::offsetGet ( mixed $index )

인수

index

The index with the value.

반환값

The value at the specified index or NULL.

오류/예외

Produces an E_NOTICE error message when the specified index does not exist.

예제

Example #1 ArrayObject::offsetGet() example

<?php
$arrayobj 
= new ArrayObject(array('zero'7'example'=>'e.g.'));
var_dump($arrayobj->offsetGet(1));
var_dump($arrayobj->offsetGet('example'));
var_dump($arrayobj->offsetExists('notfound'));
?>

위 예제의 출력:

int(7)
string(4) "e.g."
bool(false)