<?php
echo '<img style="width: 242px; height: 224px;" src="https://habrastorage.org/webt/5d/af/4f/5daf4facbe8c6020796636.png" alt="такое">';
$iplist = file('file.txt', FILE_IGNORE_NEW_LINES);
file_put_contents($file, $data, FILE_APPEND);
$str_0 = '';
$str_1 = '';
$str_2 = '';
$y = 0;
for($x = 1; $x <= 30; $x++) {
if($x % 2 !== 0) {
$str_1 .= $x . ',';
} else {
$str_2 .= $x . ',';
}
$y++;
if($y == 10) {
$str_0 .= $str_1 . $str_2;
$str_1 = '';
$str_2 = '';
$y = 0;
}
}
echo substr($str_0, 0, strlen($str_0) - 1);
//1,3,5,7,9,2,4,6,8,10,11,13,15,17,19,12,14,16,18,20,21,23,25,27,29,22,24,26,28,30
$path = '';
$path = dirname(__FILE__) . '/';
$line = 25;
$distance = 94;
if($distance > $line) {
$parts = intval($distance / $line);
for($x = 0; $x < $parts; $x++) {
echo 'Устанавливаем точку номер: ', $x . PHP_EOL;
}
}
<?php
$string = '
{
"ok": true,
"result": [
{
"message": {
"date": 1270110569,
"text": "hello",
"from": {
"first_name": "Test",
"last_name": "FGHTZX",
"is_bot": false,
"id": 234512896,
"language_code": "ru"
},
"message_id": 16,
"chat": {
"first_name": "Test",
"last_name": "FGHTZX",
"type": "private",
"id": 234512896
}
},
"update_id": 474148724
}
]
}
';
$result_parse = json_decode($string, TRUE);
$text = $result_parse['result'][0]['message']['text'];
$id = $result_parse['result'][0]['message']['message_id'];
echo 'Text: ', $text, ', id:', $id;
//Text: hello, id:16
$ip = $_SERVER ['REMOTE_ADDR'];//Не $_POST
"update ".TABLE_ADS." set `featured`=$featured_plan, `active`=1, `date_expires`=CURDATE() + INTERVAL (select `no_days` from ".TABLE_FEA_PLANS." where `id`='$id' LIMIT 1) DAY where `id`='$id'"
$this->request->redirect("/partndone/");
header('Location: /partndone/');