We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29677
    • 5 Posts
    Hello, please help me because I’m trying all without success.

    I have created this simple snippet:

    $link = 'mysite.com/es/home.html'
    $link = ereg_replace('/es/','/en/', $link);
    return $link;


    these easy php lines must print on screen: mysite.com/en/home.html

    but it never happens!!

    I’m going crazy, i have tried to use chr(47) but no success
    also I have tried it with php alone and it works

    somebody knows what is happening?
      • 4310
      • 2,310 Posts
      ereg_replace from PHP Net...
      This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.
      You could try :
      $link = 'mysite.com/es/home.html'
      $link = preg_replace('/es/','en', $link);
      return $link;
        • 29677
        • 5 Posts
        hello

        thanks for reply but still not working sad

        any idea?

        regards