jeckyl Posted January 14, 2010 Share Posted January 14, 2010 Salut à tous,Une petite question développement.J'ai le code suivant et je souhaite ajouter une ligne pour que les guillemets double " soit enlevés. function html_to_text($string){ $search = array ( "'[removed]]*?>.*?[removed]'si", // Strip out javascript "'<[\/\!]*?[^<>]*?>'si", // Strip out html tags "'([\r\n])[\s]+'", // Strip out white space "'&(quot|#34);'i", // Replace html entities "'&(amp|#38);'i", "'&(lt|#60);'i", "'&(gt|#62);'i", "'&(nbsp|#160);'i", "'&(iexcl|#161);'i", "'&(cent|#162);'i", "'&(pound|#163);'i", "'&(copy|#169);'i", "'&(reg|#174);'i", "'™'i", "''i", "''i", "'(\d+);'e" ); // evaluate as php $replace = array ( " ", " ", "\\1", " ", "&", "<", ">", " ", "¡", "¢", "£", "©", "®", "TM", "•", "-", "uchr(\\1)" ); $text = preg_replace ($search, $replace, $string); return $text; } Link to comment Share on other sites More sharing options...
jeckyl Posted January 14, 2010 Author Share Posted January 14, 2010 C'est pas la meilleur solution surement mais elle fonctionne : $c= str_replace("\"","",$c); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now