I am wondering what is the best way to compare a string with what is in the database.
Example (Before I go further, let’s just say I’m thinking of a wiki edit style)
Let’s say I pull a description from my database, and put it in a <textarea>. The user submits this with a change. And to make it a bit more complicated, this edit is in the middle of a string.
So the user changes:
“Codeigniter is a free framework.”
“CodeIgniter is an awesome framework.”
I would want to record the changes such as:
“Field changed… “...is a free fram…” to “...is an awesome fram…”
Or something of the sorts. I could compare the two if they’re the same, but I don’t want to make an over-complex function, or re-invent the wheel.. So how do you achieve this?