php in_array does not work when comparing with a mysql row

i have two postcodes entered by user. i format them validate and check if they do exist then i get postcode1's postal city name from mysql server. i have two districts both arrays one called innerLondon array and the second outterlondon array
i fetch postal city name with my script from ukpostcodes table then I use in_array to compare this postal city name to find out what district it belongs to and set flag to 1 or 0 accordingly.

The flags set will be used for other queries within the same app basically the system will not function properly if i don't
set these flags properly. I know I should use msqli or pdo but this on testing server.

PHP in_array does not set the flag to 1 or to 0 and does not work here is part of my code. Any help and advice highly appreciated.