It doesn't look like you are posting your actual code. You have a curly in $country_array[224} and the variable name $country_array224 does not look correct.
It would be easier to debug if you posted the real stuff.
Comment on Re: Using array variable in regex substitution