1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How do I get value from multi dimensional arrays?

Discussion in 'PHP' started by News Updates, Jan 14, 2015.

Thread Status:
Not open for further replies.
  1. #1
    I can easily get twitter count as follow
    echo $total_count['twitter'];
    PHP:
    But how can I get facebook likes and shares from this multi dimensional array?

    array(4) {
    ["twitter"]=>int(69)
    ["facebook"]=> array(2) {
             ["total"]=> int(469)
             ["details"]=> array(4) {
                      ["likes"]=> int(189)
                      ["shares"]=> int(153)
                      ["comment"]=> int(127)
                      ["click"]=> int(0)
                      }
             }
    ["google"]=> float(6)
    ["pinterest"]=>int(3285)
    }
    Code (markup):
    Edit: I figured out. It should be
    echo $total_count['facebook']['details']['likes'];
    PHP:
     
    Last edited: Jan 14, 2015
    News Updates, Jan 14, 2015 IP
Thread Status:
Not open for further replies.