print_r only top keys

Discussion in 'PHP' started by mnymkr, Jul 12, 2010.

  1. #1
    is it possible to print_r or var exp and only get the top levels of the array
     
    mnymkr, Jul 12, 2010 IP
  2. samb0057

    samb0057 Active Member

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    86
    #2
    I don't think this is possible with print_r but it wouldn't be too hard to write your own function to do this.
     
    samb0057, Jul 12, 2010 IP
  3. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #3
    Ellaborate?, if I understand you correctly; you could try array_slice() and then do the print_r()....
     
    danx10, Jul 14, 2010 IP