array( "verify_peer"=>false, "verify_peer_name"=>false, ), ); $jsondata = file_get_contents('http://144.202.74.208:3001/api/masternode?command=winners', false, stream_context_create($arrContextOptions)); $data = json_decode($jsondata, true); $jsondata = file_get_contents('http://144.202.74.208:3001/api/masternode?command=winners&mode=pubkey', false, stream_context_create($arrContextOptions)); $data2 = json_decode($jsondata, true); foreach($data as $list => $val) { $ipku = $list; $addr = $data2["$ipku"]; $jsondata .= "\"Block\":\"$ipku\",\"Address\":\"$addr\""; } $myFile = "/home/explorer/public/MNWL.js"; file_put_contents($myFile,$jsondata); ?>