get_setting( 'database_rows_batch' ); $offset = 0; $valid_tables = []; // loop through the tables in batches and check the selected tables against the existing tables while ( $tables_names_batch = ADBC_Tables::get_tables_names( $batch_size, $offset ) ) { foreach ( $tables_names as $table_name ) { // if the table exists, add it to the valid tables if ( key_exists( $table_name, $tables_names_batch ) ) $valid_tables[] = $table_name; } $offset += $batch_size; } return $valid_tables; } }