<?php
$url = "http://localhost/deneme/api.php?domain=https://kam****.com/urunler/altinotu/satis/index.php";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
$resp = curl_exec($curl);
curl_close($curl);
$sonuc = json_decode($resp,true);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
</html>Şu şekilde bir kodla şu çıktıyı elde ediyorum;
{"status":"1","action":"0","secenek":"0","deger":"88.230.944.67"}{"status":"1","action":"2","secenek":"1","deger":"asfdsadsads"}Bunlar kurallar, bazen 10-15 tane kural bile olabiliyor. Kısaca mesela şunu yapmak istiyorum var olan tüm ip'leri listeleyip her bir ip'yi farklı kurallara göre kontrol edeceğim. Bu verileri nasıl kontrol edebilirim?
Bunu sanırım ben veya diğer arkadaşlar göstermişti size;
<?php
$url = "http://localhost/deneme/api.php?domain=https://kam****.com/urunler/altinotu/satis/index.php";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
$resp = curl_exec($curl);
curl_close($curl);
$sonuc = json_decode($resp,true);
foreach($sonuc as $row)
{
$ip = $row['deger'];
// ÖRNEK KONTROL BU GERÇEKTEN BİR İP ADRESİMİ DEĞİLMİ
if (filter_var($ip, FILTER_VALIDATE_IP))
{
"$ip geçerli ip adresi! <br>";
}
else
{
"$ip <b>geçersiz</b> ip adresi! <br>";
}
}
?>