Files
php_8/complicated_functions/walk_recursive.php
2022-07-22 09:25:39 +03:00

26 lines
518 B
PHP

<?php
$extensions = [
'langs' => [
'PHP' => 'php',
'Python' => 'py',
'Ruby' => 'rb',
'JavaScript' => 'js'
],
'databases' => [
'PostgreSQL' => 'sql',
'MySQL' => 'sql',
'SQLite' => 'sql',
'ClickHouse' => 'sql',
'MongoDB' => 'js',
'Redis' => 'own'
]
];
function print_array(string $item, string $key) : void
{
echo "$key: $item< /br>" . PHP_EOL;
}
$handler = 'print_array';
array_walk_recursive($extensions, $handler);