How to write array("x" => array("y","z")) as [x, [y,z]] or something

Discussion in 'PHP' started by ketting00, Feb 16, 2016.

  1. #1
    I want it look like this:
    
    $x = [[y,z]];
    
    Code (markup):
    or something like that. Is it possible?
    Sorry for scant information. I do not have any idea right now, just want to try.

    Thanks,
     
    ketting00, Feb 16, 2016 IP
  2. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #2
    Replace all `array(` with `[` and `)` with `]`. It is that easy.
     
    ThePHPMaster, Feb 17, 2016 IP
  3. ketting00

    ketting00 Well-Known Member

    Messages:
    782
    Likes Received:
    28
    Best Answers:
    3
    Trophy Points:
    128
    #3
    ketting00, Feb 18, 2016 IP