offsetExists ( $index )

Access

public

Parameters

Parameter

Type

Required

Description

$index

mixed

Required

The index being checked.

Returns

Type

Description

boolean

TRUE if the requested index exists, otherwise FALSE

Examples

example

$arrayobj = new ArrayObject(array('zero', 'one', 'example'=>'e.g.'));
var_dump($arrayobj->offsetExists(1));
var_dump($arrayobj->offsetExists('example'));
var_dump($arrayobj->offsetExists('notfound'));
Result:
bool(true)
bool(true)
bool(false)

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback