TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 03-17-2010, 11:18 PM   #1 (permalink)
The Wanderer
 
Join Date: Mar 2010
Posts: 9
Thanks: 2
dc2000 is on a distinguished road
Default Trouble using regexps to explude HTML tags

Hello:


My goal is to remove all HTML tags except the following:
// <b> and </b> = Bold;
// <i> and </i> = Italic;
// <u> and </u> = Underline;
// <ul> and </ul> = List;
// <ol> and </ol> = List;
// <li> and </li> = Bullet;
// <br> = Line Break;

So if I use the following line:
PHP Code:
$res preg_replace("/<\/?(b|i|u|ul|ol|li|br){1}>/i"""$raw); 
it removes the tags that I need and keeps the rest of them.

My question is how to "reverse" it?
dc2000 is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exciting Stuff in HTML 5! Wildhoney XHTML, HTML, CSS 20 02-17-2013 03:16 PM
Replace special chars not tags, php trigered by html Peuplarchie General 0 09-20-2009 02:32 PM
Wordpress tags some show some donīt EyeDentify General 0 01-19-2009 08:21 PM
Designing a tagging system Alan @ CIT Advanced PHP Programming 4 03-10-2008 03:25 PM
HTML tags xenon Advanced PHP Programming 3 02-02-2008 04:30 PM


All times are GMT. The time now is 02:52 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design