Gayner Posted August 31, 2009 Share Posted August 31, 2009 preg_replace .. Thanks for coming here.. But I need a preg_replace that removes anything that has <meta or any type of html Refresh/JAVASCRIPT so When I allow it for my users they can use it but only works with html attributes like font color/etc.. I know it's something like this: $stxt = str_replace("+", " ", $stxt); Now Help me please.. I googled and found no answers do came here Link to comment https://forums.phpfreaks.com/topic/172534-preg_replace-replace-meta-fresh-only/ Share on other sites More sharing options...
ignace Posted August 31, 2009 Share Posted August 31, 2009 $txt = (array) preg_replace('/\<(meta|script).+\>/', '', $txt); Link to comment https://forums.phpfreaks.com/topic/172534-preg_replace-replace-meta-fresh-only/#findComment-909653 Share on other sites More sharing options...
Gayner Posted August 31, 2009 Author Share Posted August 31, 2009 $txt = (array) preg_replace('/\<(meta|script).+\>/', '', $txt); Wow really? im about to try this.. thanks a bunch.. this will be epic our users will have alot of more free time to beable to use whatever they want do i have to have array? Link to comment https://forums.phpfreaks.com/topic/172534-preg_replace-replace-meta-fresh-only/#findComment-909681 Share on other sites More sharing options...
Prismatic Posted August 31, 2009 Share Posted August 31, 2009 $txt = (array) preg_replace('/\<(meta|script).+\>/i', '', $txt); added i for case insensitive. Link to comment https://forums.phpfreaks.com/topic/172534-preg_replace-replace-meta-fresh-only/#findComment-909722 Share on other sites More sharing options...
ignace Posted August 31, 2009 Share Posted August 31, 2009 $txt = (array) preg_replace('/\<(meta|script).+\>/', '', $txt); Wow really? im about to try this.. thanks a bunch.. this will be epic our users will have alot of more free time to beable to use whatever they want do i have to have array? No. Link to comment https://forums.phpfreaks.com/topic/172534-preg_replace-replace-meta-fresh-only/#findComment-909731 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.