jesushax Posted June 17, 2008 Share Posted June 17, 2008 hi im trying to remove any classes that may be added by a wysiwyg editor i use how do it so any class name well be replaced? $data = str_replace('<p class=" anything in here">',"<p>",$data); cheers Link to comment https://forums.phpfreaks.com/topic/110557-look-for/ Share on other sites More sharing options...
zenag Posted June 17, 2008 Share Posted June 17, 2008 r u expecting like this????? $class="<p class=anything in here>"; $clas= htmlspecialchars ($class); echo $clas; $classes="<p class=nothing in here>"; $classe=htmlspecialchars($classes); $output = str_replace($clas,$classe,$clas); echo $output; Link to comment https://forums.phpfreaks.com/topic/110557-look-for/#findComment-567193 Share on other sites More sharing options...
jesushax Posted June 17, 2008 Author Share Posted June 17, 2008 so <p class="dog"> becomes <p> <p class="cat"> becomes <p> <p class="mouse"> becomes <p> <p class="cheese"> becomes <p> anything there just get convereted to a normal <p> Link to comment https://forums.phpfreaks.com/topic/110557-look-for/#findComment-567194 Share on other sites More sharing options...
zenag Posted June 17, 2008 Share Posted June 17, 2008 yeah... $class='<p class="anything in here">'; $clas= htmlspecialchars ($class); echo $clas; $classes="<p>"; $classe=htmlspecialchars($classes); $output = str_replace($clas,$classe,$clas); echo $output; converts <p class="anything in here"> to <p> Link to comment https://forums.phpfreaks.com/topic/110557-look-for/#findComment-567196 Share on other sites More sharing options...
jesushax Posted June 17, 2008 Author Share Posted June 17, 2008 i cant use that in the other function that you have given me though it wont work Link to comment https://forums.phpfreaks.com/topic/110557-look-for/#findComment-567198 Share on other sites More sharing options...
zenag Posted June 17, 2008 Share Posted June 17, 2008 think u can get some ideas from here... http://www.php-editors.com/contest/1/51-read.html Link to comment https://forums.phpfreaks.com/topic/110557-look-for/#findComment-567201 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.