nl2br and strip_tags

    Date: 02/13/08 (PHP Community)    Keywords: php, yahoo

    i'm still fairly new to php, so this questions may be pretty obvious.

    i'm trying to allow strong, em, and a tags to pass through, but i also want to keep the breaks. all is fine with strong and em, but a's attributes show through. when i get rid of nl2br, everything works, but then i lose my breaks. here is my code:

    $post = strip_tags($post, '');
    $post = nl2br($post);

    the link looks like this when it outputs:

    href="
    http://www.yahoo.com">click here

    a is missing, but the href shows through. link hovers, but of course, it doesn't take you anywhere.

    thanks in advance!

    Source: http://community.livejournal.com/php/612909.html

« PHP and Java/J2EE || breadcrumbs »


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