I have a string which i'm putting into a XML file.. problem is my vb program which is reading it does not like some of the characters...

How can i remove anything which is not a-z or 0-9 ???

Invalid character in the given encoding. Line 3, position 123.

    $reg_exp = "[^A-Za-z0-9]"; // this searches for anything not A-Z, a-z, and 0-9
    $string = $mystring['data']; // this is what you are searching through
    $replace = ''; // this is what you are going to replace the special chars with
    
    preg_replace($reg_exp, $replace, $string);

      I did this

      $Body = iconv("UTF-8","UTF-8//IGNORE",$Body); 
        Write a Reply...