Mehdi Posted June 29, 2007 Share Posted June 29, 2007 Hi, I work on an ubuntu system with php 5.2.1. The next code doesn't convert my string to entities! Could you guide me please? <html> <head> <title>Text including html</title> </head> <body> <?php echo phpinfo(); $str= <<<TEXT Einstürzende Neubauten and Marya's & Mother and again "test". TEXT; $code=htmlentities($str, ENT_QUOTES); $code1=htmlspecialchars($str); echo $code,"<br>",$code1; ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
chocopi Posted June 29, 2007 Share Posted June 29, 2007 well can give the text you are using, what are getting and what you expect to get please ? Quote Link to comment Share on other sites More sharing options...
Mehdi Posted June 29, 2007 Author Share Posted June 29, 2007 I'm getting this: Einstürzende Neubauten and Marya's & Mother and again "test". Einstürzende Neubauten and Marya's & Mother and again "test". Quote Link to comment Share on other sites More sharing options...
Mehdi Posted June 29, 2007 Author Share Posted June 29, 2007 At the first line, the characters &, " and ' have to convert to entities, don't they? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.