preg_replace_callback « String « PHP






1.Using preg_replace_callback() to Replace Patterns
2.Generating replacement strings with a callback function
3.Generating replacement strings with an anonymous function