![]() |
|
|
#24 |
|
Архивный участник
Join Date: Apr 2006
Posts: 729
|
Guaresnay:
1. why you're getting itemnames through sql and not simply parse item_pch? ![]() Code:
foreach(file("item_pch.txt") as $iitem){
str_replace(array("\xFF\xFE","\x00"),"",trim($iitem));
$iitem=str_replace(array(" ","\t"),"",$iitem);
$eitem=explode("=",$iitem);
$itemids[($eitem[1])]=str_replace(array("[","]"),"",$eitem[0]);
}
// after that you may use for example $itemids[1], it returns short_sword.
Code:
function get_type($type){
switch($type){
...
default:
$type="citizen";break; //every case need to break, or switch will continue from begining, you forgot about it.
}
return $type;
}
|
|
|
|
|