I am trying to loop thru an array containing several objects and changing the value of the misspelled objects to to correct spelling to work with later on, but I haven’t been able to set the new value for each object the loop is on… I figure the code below is the start of it, if anyone could help me out with setting each new value and saving it back in the array that would be much appreciated. Thanks
foreach($cities as $city) {
if(($city->loc_city) == "misspelling") {
// insert new value for loc_city;
}
}