Syntax:int ArrayIterator::getFlags (void)
Parameters:This function takes no parameters.
Return value:This function returns flags for the behavior of the ArrayIterator.The following programs illustrate the ArrayIterator function::getFlags() in PHP:
Program 1:
// Declare ArrayIterator
$arrItr
=
new
ArrayIterator (
array
(
’G’
,
’ e’
,
’e’
,
’ k’
,
’s’
,
’ f’
,
’o’
,
’r’
)
);
// Get the flag
$flag
=
$arrItr
-> getFlags();
// Show flag
var_dump (
$flag
);
?>
Exit:int (0 )
Program 2:
// Declare ArrayIterator
$arrItr
=
new
ArrayIterator (
array
(
" Geeks "
,
" for "
,
"Geeks"
)
);
// Add item to array
$arrItr
-> append (
"Computer"
);
$arrItr
-> append (
"Science"
);
$arrItr
-> append (
"Portal"
);
// Get the flag
$flag
=
$arrItr
-> getFlags();
// Display the flag value
var_dump (
$flag
);
?>
Exit:int (0 )
Link: https://www.php.net /manual/en/arrayiterator.getflags.php