I'm stuck on this task - to divide the array into two and process it. The situation is as follows:
$selectCity = "select districtName from telegramCity limit 12 offset 0";
$result = mysqli_query($this->connection, $selectCity);
while ($row = mysqli_fetch_assoc($result)) {
$this->buttons[] = [[
"text" => $row["districtName"],
"callback_data" => strval(0)
],[
"text" => $row["districtName"],
"callback_data" => strval(0)
]];
}`
As you can see, there are two identical arrays, each with 12 records. But I need to make it so that each has 6. Please, please, tell me how it can be done ><
I don't need duplicate arrays. I have list of 12 cities and I need to put them into Telegram inline_button, where should be 2 columns, each has 6 cities