Topic awaiting preservation: preg_replace using arrays not always working... |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 09-05-2005 02:13
Greetings! code: $search = array ( "'Twsp'i", "'Twshp'i", "'Twnshp'i", "'Twp'i", "'Hts'i", "'Hgts'i", "'Centerline'i", "'Fairhaven'i", "'Rosevillen'i", "'^Rosevill$'i", "'St Clair Shores'i", "'Harriston'i", "'^Washington$'i", "'^Sterling Height$'i", "'Sterlingheights'i", "'Sterlingheigheights'i", "'Sterlingheigheights'i", "'MT CLEMENS'i", "'MTCLEMENS'i", "'CHESTEFIELD'i", "'Rosevile'i", "'^MACOMB$'i", "'^CHESTERFIELD$'i", "'^RILEY$'i", "'BLOOMFEILDHILLS'i", "'BLOOMFIELDHILLS'i", "'COMERCETOWNSHIP'i", "'FARM HILLS'i", "'/FARMINGTON HILL/'i", "'FARMINGTONHILLS'i", "'FERNDALED'i", "'HAZEL PARKQ'i", "'MADISON HEIGHEIGHTS'i", "'PONTAIC'i", "'ROCHESTER HLS'i", "'ROSHESTER HILLS'i", "'ST CLAIR SHRS'i", "'STERLING HGHEIGHTS'i", "'W BLOOMFIELD'i", "'/WARR/'i", "'WATERFPRD'i", "'/CLA/'i", "'/FAH/'i", "'/CLINTON TOWNSHI/'i", "'/FARMINGTON HILL/'i", "'/WATEROFRD/'i" ); $replace = array ( "TOWNSHIP", "TOWNSHIP", "TOWNSHIP", "TOWNSHIP", "HEIGHTS", "HEIGHTS", "CENTER LINE", "FAIR HAVEN", "ROSEVILLE", "ROSEVILLE", "SAINT CLAIR SHORES", "HARRISON", "WASHINGTON TOWNSHIP", "STERLING HEIGHTS", "STERLING HEIGHTS", "STERLING HEIGHTS", "STERLING HEIGHTS", "MOUNT CLEMENS", "MOUNT CLEMENS", "CHESTERFIELD", "ROSEVILLE", "MACOMB TOWNSHIP", "CHESTERFIELD TOWNSHIP", "RILEY TOWNSHIP", "BLOOMFIELD HILLS", "BLOOMFIELD HILLS", "COMMERCE TOWNSHIP", "FARMINGTON HILLS", "FARMINGTON HILLS", "FARMINGTON HILLS", "FERNDALE", "HAZEL PARK", "MADISON HEIGHTS", "PONTIAC", "ROCHESTER HILLS", "ROCHESTER HILLS", "SAINT CLAIR SHORES", "STERLING HEIGHTS", "WEST BLOOMFIELD", "WARREN", "WATERFORD", "CLAWSON", "FARMINGTON HILLS", "CLINTON TOWNSHI", "FARMINGTON HILLS", "WATERFORD" );
code: $profile[city] = preg_replace($search, $replace, $profile[city]);
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 09-05-2005 21:53
Since you're actually allowed to use any delimeter It may be that |