Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $lang = [
- "whistik" => [
- "je" => [
- "profik" => "Nie",
- "lamka" => "Ano"
- ]
- ]
- ];
- function getLanguageNode($path)
- {
- global $lang;
- $levels = explode(">", $path);
- $latestNode = $lang;
- for ($level = 0; $level < count($levels); $level++) {
- if (isset($latestNode[$levels[$level]])) {
- $latestNode = $latestNode[$levels[$level]];
- } else {
- return false;
- }
- }
- return $latestNode;
- }
- echo getLanguageNode("whistik>je>lamka");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement