Top "Preg-replace-callback" questions

preg_replace_callback() is a PHP function that uses regular expressions to find substrings and a PHP callback function to perform the replacement.

Replace deprecated preg_replace /e with preg_replace_callback

$result = preg_replace( "/\{([<>])([a-zA-Z0-9_]*)(\?{0,1})([a-zA-Z0-9_]*)\}(.*)\{\\1\/\\2\}/iseU", "CallFunction('\\1','\\2','\\3','\\4','\\5…

php preg-replace preg-replace-callback php-5.5
Replace preg_replace() e modifier with preg_replace_callback

I'm terrible with regular expressions. I'm trying to replace this: public static function camelize($word) { return preg_replace('/(^|_)([a-z])/…

php regex preg-replace preg-replace-callback
How to use preg_replace_callback?

I have the following HTML statement [otsection]Wallpapers[/otsection] WALLPAPERS GO HERE [otsection]Videos[/otsection] VIDEOS GO HERE What I …

php preg-replace preg-replace-callback
Symfony 1.4 using deprecated functions in php 5.5

I recently upgraded PHP from version 5.3.27 to 5.5.0. Everything is working fine in my Symfony 2.3.2 project, and I can enjoy the …

php preg-replace symfony-1.4 preg-replace-callback
PHP7 - The /e modifier is no longer supported, use preg_replace_callback instead

Can somebody help me with this error I'm getting? Warning: preg_replace(): The /e modifier is no longer supported, use …

php preg-replace preg-replace-callback
Replace preg_replace() to preg_replace_callback()

$source = preg_replace('/&#(\d+);/me', "utf8_encode(chr(\\1))", $source); The above code gives deprecated warning. Deprecated: preg_replace(): …

php preg-replace preg-replace-callback
Is there a way to pass another parameter in the preg_replace_callback callback function?

mmmh guys, i really hope my english is good enaught to explain what i need. Lets take this example (that …

php preg-replace preg-match preg-match-all preg-replace-callback
Warning: preg_replace_callback(): Requires argument 2

I just updated PHP on my server from php 5 to php 7 and I'm getting these warnings: Warning: preg_replace_callback() […

php preg-replace-callback
PHP Regex Replace Image SRC Attribute

I'm trying to find a regular expression that would allow me replace the SRC attribute in an image. Here is …

php html regex src preg-replace-callback