Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while($post = $db->fetch_assoc($result)) {
- $posts = []; //Пустой массив для результатов слияния
- $tmp = [ //Временный массив для хранения аргумента(слагаемого)
- [
- 'id' => $post['id'],
- 'date' => $post['date'],
- 'text' => $post['text']
- ],
- ];
- $posts = array_merge($posts, $tmp);
- }
- echo '<pre>';
- print_r($posts);
- echo '</pre>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement