mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-11-29 17:06:51 +01:00
Item parser + functions
This commit is contained in:
35
engine/function/itemparser/itemlistparser.php
Normal file
35
engine/function/itemparser/itemlistparser.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
function getItemNameById($id) {
|
||||
|
||||
$item_list = explode(PHP_EOL, file_get_contents('item_list.txt'));
|
||||
|
||||
foreach ($item_list as $items) {
|
||||
|
||||
$item_array = explode('@', $items);
|
||||
|
||||
if ($item_array[0] == $id) {
|
||||
|
||||
echo ucfirst($item_array[1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getItemIdByName($name) {
|
||||
|
||||
$item_list = explode(PHP_EOL, file_get_contents('item_list.txt'));
|
||||
|
||||
foreach ($item_list as $items) {
|
||||
|
||||
$item_array = explode('@', $items);
|
||||
|
||||
if ($item_array[1] == $name) {
|
||||
|
||||
echo ucfirst($item_array[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user