0

I want to convert the below shown PHP array to a C# array.

I'm not sure how to do this.

Please help me to port this.

<?php
$var["figures"]["en"] = array(
    array(
        "table"    => "Revenue",
        "box"      => "Revenue",
        "axis"     => "Revenue",
        "legend"   => "Revenue",
        "link"     => "",
        "target"   => "",
        "footnote" => "",
        "unit"     => '',
        "stacked"  => '',
        "icon"     => ""
    ),
    array(
        "table"    => "PBIT",
        "box"      => "PBIT",
        "axis"     => "PBIT",
        "legend"   => "PBIT",
        "link"     => "",
        "target"   => "",
        "footnote" => "",
        "unit"     => '',
        "stacked"  => '',
        "icon"     => ""
    )
);
print_r($var);
?>
karthik
  • 83
  • 2
  • 12

1 Answers1

1

C# does not support array's with string indexes. A Dictionary is the closest you can get.

For a good example, have a look at this question.

Community
  • 1
  • 1
Patrick Kostjens
  • 5,065
  • 6
  • 29
  • 46