<?php
$str = '{
"site":[
{
"tab":{
"lookup":"primer_pole",
"label":"primer"
},
"settings":[
{
"lookup":"qw_qw",
"label":"qwqw",
"type":"text",
"access":"normal"
}
]
},
{
"tab":{
"lookup":"mail-form",
"label":"mail-form"
},
"settings":[
{
"lookup":"email",
"label":"email",
"type":"text",
"access":"normal",
"value":"paw.rus@yandex.ru"
}
]
}
]
}';
$json = json_decode($str, true);
$email = $json['site'][1]['settings'][0]['value'];
$credit = 40000;
$percent = 1.03;
$service = 1000;
$payUser = 5000;
$totalUser = 0;
for ($mes=1; $mes<=20; $mes++) {
$credit = ($credit * $percent) + $service - $payUser;
$totalUser = $payUser * $mes;
echo "Спустя $mes мес. мы должны банку еще $credit руб. // Выплачено нами $totalUser руб.<br>";
if ($credit < $payUser) {
$totalUser = $credit + $totalUser;
$credit = $credit - $credit;
$mes = $mes +1;
echo "Спустя $mes мес. мы должны банку еще $credit руб. // Выплачено нами $totalUser руб.<br>Хватит с меня!";
break;
}
}
echo $iter;
и будет вам номер.