Is there a way to automatically replace an echoed word or phrase in PHP with something predfined? I tried using define()
, but that isn't working the way I'd like (or maybe I'm not doing it correctly.
In my database I have all US states but their names are abbreviated as such; MO, AK, AL, IL...
What I'd like to do is create a file that defines MO as Missouri, and IL as Illinois and when MO is echoed, it is automatically replaced with Missouri.
Is there a good way to do this?