how to use this function with different languages ereg_replace [^A-Za-z0-9] ?

Discussion in 'PHP' started by ramysarwat, Nov 15, 2010.

  1. #1
    how to use this function with different languages ?

    $new_string = ereg_replace("[^A-Za-z0-9]", "", $string);
     
    ramysarwat, Nov 15, 2010 IP
  2. imocoder

    imocoder Member

    Messages:
    45
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #2
    First of all function ereg_replace() has been deprecated in the new PHP. You should use consider using preg_replace().
    Second, try using mb_internal_encoding('utf-8'); before you make a replace.

    Hope this helps.
     
    imocoder, Nov 15, 2010 IP