Jump to content

[SOLVED] Extracting Data from Multidimensional Associative Array


robgood

Recommended Posts

Getting un-serialised PHP from a API use http GET

 

$timetotals = file_get_contents($timetotals);

 

the results when print_r($timetotals) gives...

 

Array

(

    [0] => Array

        (

            [value] => 5880

        )

 

)

 

I am trying to extract the number 5880 into a variable $value have tried lots of things including below...but can't seem to get it work       

       

foreach($timetotals as $key =>$array)
        {
          foreach($array as $secondkey=>$value)
          {
            echo "<p>$value</p>";
          }
        }

 

Any help would be appreciated

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.