Home > Software engineering >  what data structure is this? - What language?
what data structure is this? - What language?

Time:10-28

[35 => "Rocko", 36 => "Modern", 37 => "Life"]

I am not sure what that is or what language that is.

It looks like:

[{
"35":"Rocko",
"36":"Modern",
"37":"Life"
}]

for python but I am pretty sure that is not python. lol

CodePudding user response:

The syntax looks like it could be PHP. Consider the following short PHP script:

$array = [35 => "Rocko", 36 => "Modern", 37 => "Life"];
print_r($array);

This prints:

Array
(
    [35] => Rocko
    [36] => Modern
    [37] => Life
)
  • Related