[Solved] how to sum the array time [closed]

[ad_1] $totalTimeSecs = 0; foreach ($array as $l1) { // Loop outer array foreach ($l1 as $l2) { // Loop inner arrays if (isset($l2[‘jQuery’][‘length’])) { // Check this item has a length list($hours,$mins,$secs) = explode(‘:’,$l2[‘jQuery’][‘length’]); // Split into H:m:s $totalTimeSecs += (int) ltrim($secs,’0′); // Add seconds to total $totalTimeSecs += ((int) ltrim($mins,’0′)) * 60; // … Read more

[Solved] Parsing definitions in json format from Wikipedia API in php [closed]

[ad_1] Which parameters did you use in your request? You can take this as an example: https://en.wikipedia.org/w/api.php?action=opensearch&search=PHP&limit=1&format=json You said there that you want only the first definition, so you can put limit=1. The response is in json. 1 [ad_2] solved Parsing definitions in json format from Wikipedia API in php [closed]