我怎么会去这个PHP数组转换成C#转换一个PHP数组到C#
$hiscores = array("Overall",
"stats" => array(
"Attack", "Defence", "Strength",
"Hitpoints", "Ranged", "Prayer",
"Magic", "Cooking", "Woodcutting",
"Fletching", "Fishing", "Firemaking",
"Crafting", "Smithing", "Mining",
"Herblore", "Agility", "Thieving",
"Slayer", "Farming", "Runecrafting",
"Hunter", "Construction", "Summoning",
"Dungeoneering"
),
"minigames" => array(
"Duel Tournaments", "Bounty Hunters",
"Bounty Hunter Rogues", "Fist of Guthix",
"Mobilising Armies", "B.A Attackers",
"B.A Defenders", "B.A Healers",
"Castle Wars Games", "Conquest"
)
);
我发现PHP语法很混乱,所以我不能告诉我怎么会去亲自做这个。
从我可以告诉它会是这样的:
string[] hiscores = new string["Overall","stats","minigames"]
但是“统计”和“小游戏”不包含字符串喜欢他们在PHP代码做。
我也不确定“=> array()”是什么意思。
取决于你想要用这个结构做什么。可能是一个'Dictionary>',可能是一个自定义类,可能是别的。不要挂在语言之间的逐行转换上。用目标语言实现功能。 –
David
我建议你阅读:http://php.net/manual/en/language.types.array.php –