<?php
$all_states = [
"Ontario" => 0,
"Manitoba" => 0,
"New Brunswick" => 0,
"Yukon" => 0,
"Saskatchewan" => 0,
"Prince Edward Island" => 0,
"Alberta" => 0,
"Quebec" => 0,
"Nova Scotia" => 0,
"British Columbia" => 0,
"Nunavut" => 0,
"Newfoundland and Labrador" => 0,
"Northwest Territories" => 0
];
$country_states = [
"Alberta" => 17,
"Cairo" => 1,
"Calgary" => 1,
"ddd" => 4,
"gfdxf" => 1,
"New Cairo" => 1,
"Ontario" => 1,
"secret" => 30
];
var_export(array_replace($all_states, $country_states));
preferences:
27.2 ms | 405 KiB | 5 Q