If it’s just a list of numbers, I’d suggest just saving them in a text file, with a number on each line.
110019
111222
112233
Then when you need the file, read its contents with PHP, and use preg_split()
to turn it into an array:
$file_path = plugin_dir_path( 'postcodes.txt', __FILE__ ); // Or wherever you've placed it.
$file_contents = file_get_contents( $file_path );
$postcodes = preg_split( "/\r\n|\n|\r/", $file_contents );
if ( in_array( $postcode, $postcodes ) ) {
}
That preg_split()
method for splitting text based on newlines is taken from here.