hassank1 Posted March 30, 2008 Share Posted March 30, 2008 Hii I am using this function to disable html... function cleanText($text,$WrapWidth) //clean post from html + wordwrap + convert \n to <br> { $text=htmlentities($text); //disable (html and script code) -> for security reasons $text=stripslashes($text); //convert (/') => (') $text=wordwrap($text, $WrapWidth, "\n"); //replace \n by <br> and make a wordwrap $text=wordwrap($text, $WrapWidth+5, "\n", true); $text=nl2br($text); return $text; } however the non-english text are changed to ex: ;وم فما ... how can I display this text and still disabling the other html tags !! Quote Link to comment https://forums.phpfreaks.com/topic/98613-showing-non-english-text-after-using-htmlentities/ Share on other sites More sharing options...
marcus Posted March 30, 2008 Share Posted March 30, 2008 html entities is going to convert & to & Use strip_tags, or str_replace to replace the monumental tags, < and > Quote Link to comment https://forums.phpfreaks.com/topic/98613-showing-non-english-text-after-using-htmlentities/#findComment-504674 Share on other sites More sharing options...
hassank1 Posted March 30, 2008 Author Share Posted March 30, 2008 would explain more plz ... !! Quote Link to comment https://forums.phpfreaks.com/topic/98613-showing-non-english-text-after-using-htmlentities/#findComment-504677 Share on other sites More sharing options...
wildteen88 Posted March 30, 2008 Share Posted March 30, 2008 If you want to remove all html tags you can just use strip_tags function. htmlentities will convert all characters which have an html entity equivalent will be converted. If you only want to convert only html characters then use htmlspecialchars Quote Link to comment https://forums.phpfreaks.com/topic/98613-showing-non-english-text-after-using-htmlentities/#findComment-504678 Share on other sites More sharing options...
hassank1 Posted March 30, 2008 Author Share Posted March 30, 2008 thx .. however , why the function convert & to & ? what's the point of that? Quote Link to comment https://forums.phpfreaks.com/topic/98613-showing-non-english-text-after-using-htmlentities/#findComment-504712 Share on other sites More sharing options...
maexus Posted March 30, 2008 Share Posted March 30, 2008 That's how & should be typed in a html document. & will display as & in the browser. Quote Link to comment https://forums.phpfreaks.com/topic/98613-showing-non-english-text-after-using-htmlentities/#findComment-504721 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.