I want to get "12abc" , but it outputs: 12$AB_C , so, it not recognize the replacement as dynamic variable.
Is it any way to use the matched word in preg_replace() as a variable, or dynamic variable?
This code will throw a "Undefined variable" notice if the variable "$$1" has not been defined. You could replace the "$$1" with a function like the following to prevent these notices.