Что я делаю не так?Не занимаетесь отладкой своей программы. Если не умеете пользоваться отладчиком, то возьмите лист бумаги, карандаш, и пошагово пройдите всю свою программу.
0000000000000000000000111100000000001111111100000001111111111000001111111331110001111111132311000111111111331100333311111111111001133111111111100111311111111110112131111111111011113111111111101111311111111110011233111113333300222331133322200222203333002222
0000000000000000
0000001111000000
0000111111110000
0001111111111000
0011111113311100
0111111113231100
0111111111331100
3333111111111110
0113311111111110
0111311111111110
1121311111111110
1111311111111110
1111311111111110
0112331111133333
0022233113332220
0222203333002222
$data = [];
while ($z->name === 'offer') {
...
$data[] = '("'.$id.'","'.htmlspecialchars(urldecode($url)).'","'.$today.'",'.(int)$price.')';
if (count($data) > 99) {
$sql = 'INSERT INTO `products` (`id`,`url`,`date`,`price`) VALUES '
. implode(',', $data)
. 'ON DUPLICATE KEY UPDATE `url` = VALUES(`url`), `price` = VALUES(`price`)';
mysqli_query($link6,$sql);
$data = [];
}
...
}
if (count($data) > 0) {
$sql = 'INSERT INTO `products` (`id`,`url`,`date`,`price`) VALUES '
. implode(',', $data)
. 'ON DUPLICATE KEY UPDATE `url` = VALUES(`url`), `price` = VALUES(`price`)';
mysqli_query($link6,$sql);
}
$array = [
[
"gq_address" => "188.120.254.140",
"gq_hostname" => "• RGPlay | DarkRP [Быстрая загрузка]",
"gq_maxplayers" => 128,
"gq_numplayers" => 0,
"gq_online" => true,
"gq_port_client" => 27015,
], [
"gq_address" => "62.109.18.242",
"gq_hostname" => "Default Breach Server",
"gq_maxplayers" => 128,
"gq_numplayers" => 0,
"gq_online" => true,
"gq_port_client" => 27015,
]
];
$array = array_map(function($el) {
return [
'gq_hostname' => $el['gq_hostname'],
'gq_address' => $el['gq_address'],
'gq_port_client' => $el['gq_port_client'],
'gq_online' => $el['gq_online'],
'gq_numplayers' => $el['gq_numplayers'],
'gq_maxplayers' => $el['gq_maxplayers']
];
}, $array);
var_dump($array);
array(2) {
[0] => array(6) {
["gq_hostname"] => string(55) "• RGPlay | DarkRP [Быстрая загрузка]"
["gq_address"] => string(15) "188.120.254.140"
["gq_port_client"] => int(27015)
["gq_online"] => bool(true)
["gq_numplayers"] => int(0)
["gq_maxplayers"] => int(128)
}
[1] => array(6) {
["gq_hostname"] => string(21) "Default Breach Server"
["gq_address"] => string(13) "62.109.18.242"
["gq_port_client"] => int(27015)
["gq_online"] => bool(true)
["gq_numplayers"] => int(0)
["gq_maxplayers"] => int(128)
}
}