RegEx Help - Updated

    Date: 07/23/05 (PHP Community)    Keywords: php

    Hey everyone!

    Rather than going through the replies to the post earlier I decided to create a new post to further explain myself. From time to time I get kinda wrapped up in the details of coding something and usually end up trying to explain concepts to non-technical people through abstract terms. For some reason I was in that frame of mind when I posted to this group. Basically, I am *very* guilty of under-estimating the level of understanding of the php group. What I should have said is this:

    In php, the strip_tags() function works ok, but it ignores the attributes of the allowed tags which leaves it open to things like this:

    Ha Ha!


    What I was trying to do was to write a more robust version of the strip_tags() function that would also allow you to declare allowable attributes (such as "href" for and anchor tags).

    So, restated, what I'm trying to do is take a string like


    and remove EVERYTHING but this:


    I apologize for the totally brain-dead way in which I stated the original question and I promise to think (more) before I post. It's just that trying to explain this concept to some of the non-geeks that I work with kinda got stuck in my brain.

    /me puts on asbestos suit and ducks

    Source: http://www.livejournal.com/community/php/324373.html

« Time handling problem || Sticky File »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home