0

I have read all the questions and answers here and am having trouble converting the following depricated eregi function

for ($i=0, $n=sizeof($this->browser_languages); $i<$n; $i++) {
    reset($this->languages);
    while (list($key, $value) = each($this->languages)) {
      if (eregi ("^(" . $value . ")(;q=[0-9]\\.[0-9])?$",      $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) {
        $this->language = $this->catalog_languages[$key];
        break 2;
      }
    }

Can someone please help me figure this out. I have tried some things already but nothing seems to work. Thank you for any help

bbg

  • possible duplicate of [Function eregi() is deprecated](http://stackoverflow.com/questions/5700806/function-eregi-is-deprecated) – Lorenz Meyer Jan 22 '15 at 05:30
  • There is no difficulty here : just add / at the beginning and the end. – Lorenz Meyer Jan 22 '15 at 05:31
  • Possible duplicate of [How can I convert ereg expressions to preg in PHP?](https://stackoverflow.com/questions/6270004/how-can-i-convert-ereg-expressions-to-preg-in-php) – Toto Jun 02 '19 at 11:40

0 Answers0