View Single Post
  #9 (permalink)  
Old Apr 20th, 2007, 12:07
masonbarge's Avatar
masonbarge masonbarge is offline
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: There has to be an easier way

Thanks so much for the pointer. I'll play around with it this morning. My instinct is to use str_replace rather than preg_replace, do you see any problem with that?

Or since I only use it on a query resource -- 80%+ of my database is from the USDA (US Dept of Agriculture), which is in all caps and uses these horrid overlapping abbreviations -- maybe I'll try just putting up a little table in the same db and figure out a way to combine the two searches. That'd keep the buggers out of my code and give me a nice array right off.

Edit: Hmm, now you really have me stirred up. If I have the guts I may just run a search/replace on the database and solve the problem once and for all - replace the abbreviations and put it in lower case.
Quote:
Of course, if you get paid by the line of code written . . . this approach probably isn't for you
:dry: Well, Dickens got paid by the word (and schoolchildren have paid dearly for it ever since).

Last edited by masonbarge; Apr 20th, 2007 at 12:15.
Reply With Quote