input() as $post_key => $value ) { if ( $value !== 'yes' ) continue; $post_id = explode('-', $post_key)[1]; $post_ids[] = $post_id; $posts->delete(['post_id' => $post_id]); } $page->title('EECS 448 Lab 10 - Exercise 7') ->header('Posts Deleted') ->writes('

Posts with the following IDs were deleted: ' . implode(', ', $post_ids) . '

') ->writes('Admin Home'); $page->write();