0

I have warning in php in this line

$text = preg_replace_callback('/LANG\[([0-9a-z_]*?)\]/e','word(\\1)',$read);

how to fix this issue

Dharman
  • 26,923
  • 21
  • 73
  • 125
Yousef Abu Sallamah
  • 206
  • 1
  • 2
  • 15

1 Answers1

0

Matched group is passed to callback function by default. So your code should be like this.

$text = preg_replace_callback('/LANG\[([0-9a-z_]*?)\]/','word',$read);

In your callback you can access matched group like this.

function word($matches)
  {
   //$matches[0] will be while matched string
   //$matches[1] will be your first matched group
   }

/e flag was DEPRECATED in PHP 5.5.0, and REMOVED as of PHP 7.0.0

So, avoid using /e flag. For more information it's worth have look here

8bitIcon
  • 2,619
  • 2
  • 22
  • 47