Я сравнил все значения массива, используя следующий код.Я надеюсь, что это может помочь вам:
$t = json_decode(file_get_contents('https://gist.githubusercontent.com/mshafrir/2646763/raw/8b0dbb93521f5d6889502305335104218454c2bf/states_titlecase.json'), true);
$t_array = array();
foreach($t as $k => $row){
array_push($t_array, $row['name']);
}
$reg_state = array(
array('Connecticut',' Maine',' Massachusetts',' New Hampshire',' Rhode Island',' Vermont'),
array('New Jersey',' New York',' Puerto Rico',' US Virgin Islands'),
array('Delaware',' District of Columbia',' Maryland',' Pennsylvania',' Virginia',' West Virginia'),
array('Alabama',' Florida',' Georgia',' Kentucky',' Mississippi',' North Carolina',' South Carolina',' Tennessee'),
array('Illinois',' Indiana',' Michigan',' Minnesota',' Ohio',' Wisconsin'),
array('Arkansas',' Louisiana',' New Mexico',' Oklahoma',' Texas'),
array('Iowa',' Kansas',' Missouri',' Nebraska'),
array('Colorado',' Montana',' North Dakota',' South Dakota',' Utah',' Wyoming'),
array('Arizona',' California',' Hawaii',' Nevada',' American Samoa',' Guam',' Northern Mariana Islands'),
array('Alaska',' Idaho',' Oregon',' Washington')
);
$reg_state_short = array();
foreach($reg_state as $k => $row){
foreach($row as $k2 => $row2){
if(in_array($row2, $t_array)){
array_push($reg_state_short, $row2);
}
}
}
print_r($reg_state_short);