Brimbox Logo Brimbox Version 2.3.4 Released


Method to return the next available numeric key in an array. Used in situations where array items have been deleted. For example, if populated keys are 1, 2, 4 ,6, this method will return 3.

Class: bb_database, called as $main

File: bb_database.php (php)


function get_next_node($arr, $limit)


$main->get_next_node($arr, $limit);

Returns: Integer indicating the next possible numerical position in a set of array keys. Will return maximum key + 1 if array keys are perfectly ascending, -1 if limit of nodes is exceeded.

Parameter: $arr (array)
An array with numeric keys.

Parameter: $limit (integer)
Maximum number of items in allowed in array.

Updated: 2016-07-09