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);
?>

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.