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
  • 30,962
  • 25
  • 85
  • 135
Yousef Abu Sallamah
  • 225
  • 1
  • 2
  • 17

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

sujeet
  • 3,480
  • 3
  • 28
  • 60