I want to search an array with words like "new" "York" "other" "thing", and combine only the ones that make up the words of a state.
In this example, I want the matches for states to be combined in the array:
From this:
<?php
$states = array("new york", "Nevada");
$names = array("something", "green", "something", "yellow", "new", "york", "new","jersey");
To this:
$names = ( "something", "green", "something", "yellow", "new york", "new jersey");
Hence altering the the names array to combine the states.
$statesarray contained all 50 states, how would it know whether new applied to New York or New Jersey?$states = array("new york", "Nevada");