I have the following string
"Enter Contarct Fields wherever you want and enclose it with {}.You can use field's id or field's fieldcode for example {25} or {FIELD_CONTRACTTEXT}"
I want to replace this {25} and {FIELD_CONTRACTTEXT} with their equivalent value from databse.
Say 25 is a ID so I wanted to put name of the field of which 25 is the ID of.
There are many examples of replacing curly braces but no solution is there for replacing content like this. Please help me, I have tried many things.
PS: Please keep in mind that occurrence of {} is dynamic and 25 will not be a static number and there can be multiple {} in a string.
preg_replace_callback.