- var_dump: documentation ( source)
- array_shift: documentation ( source)
- key: documentation ( source)
- next: documentation ( source)
- current: documentation ( source)
<?php
$tables = [
[
'key1' => 'value1',
'key2' => 'value2'
],
[
'key3' => 'value3',
'key4' => 'value4'
],
];
echo 'List Each' . \PHP_EOL;
foreach ($tables as $table_array) {
list(,$table) = each($table_array);
var_dump($table);
}
echo \PHP_EOL;
echo 'Array Shift'. \PHP_EOL;
foreach ($tables as $table_array) {
$table = array_shift($table_array);
var_dump($table);
}
echo \PHP_EOL;
echo 'Current Next' . \PHP_EOL;
foreach ($tables as $table_array) {
$table = current($table_array);
var_dump($table);
next($table_array);
}
echo \PHP_EOL;
echo 'Current Next w/key' . \PHP_EOL;
foreach ($tables as $table_array) {
$key = key($table_array);
$table = current($table_array);
var_dump($key, $table);
next($table_array);
}