MDanz Posted June 19, 2010 Share Posted June 19, 2010 i'm having a problem. i display some text in a textarea. e.g. $variable = car1>>car2. $variable2= htmlentities($variable); in the textarea it displays $variable2 as car1>>car2 how do i solve this. In the textarea it should display as car1>>car2. Link to comment https://forums.phpfreaks.com/topic/205262-htmlentities-and-textarea/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 19, 2010 Share Posted June 19, 2010 in the textarea it displays $variable2 as car1>>car2 No it doesn't. The only way it will do what you state is if the data has htmlentities() applied twice. Link to comment https://forums.phpfreaks.com/topic/205262-htmlentities-and-textarea/#findComment-1074395 Share on other sites More sharing options...
MDanz Posted June 19, 2010 Author Share Posted June 19, 2010 this is my code, here's what i tried to resolve it... $sumz= "car1>>car2"; $textsearch = array('<','>'); $textreplace = array ('<','>'); $textareatext = "$sumz"; echo "<div style='display:none;' id='$number'>".str_replace($textsearch,$textreplace,htmlentities($textareatext))."</div>"; In the textarea it displays this car1 >>car2 Link to comment https://forums.phpfreaks.com/topic/205262-htmlentities-and-textarea/#findComment-1074399 Share on other sites More sharing options...
PFMaBiSmAd Posted June 21, 2010 Share Posted June 21, 2010 This problem was continued in a different thread. Link to comment https://forums.phpfreaks.com/topic/205262-htmlentities-and-textarea/#findComment-1075054 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.