<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.uptimerobot.com/v2/getMonitors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "api_key=u859463-xxxx&format=xml&custom_uptime_ratios=1-2-3-4-5-6-7-30",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>yukarıdaki kod ile veriyi aşağıdaki gibi xml olarak alıyorum sizlerden ricam custom_uptime_ratio daki değerleri ayırarak almam gerekiyor "100.000-100.000-100.000-100.000-100.000-100.000-100.000-100.000" - işaretlerinden olanları 1. si 1. gün mesela 2. si 2. gün toplam 7 günün değeri var birde 30 gün bunları ayırabilir miyiz.
<monitor id="784209035" friendly_name="NExxxOR-TR" url="xx.169.xx.66" type="4" sub_type="1" keyword_type="null" keyword_value="" http_username="" http_password="" port="80" interval="300" status="2" create_datetime="1579914764" custom_uptime_ratio="100.000-100.000-100.000-100.000-100.000-100.000-100.000-100.000" custom_down_durations="0-0-0-0-0-0-0-0"/>