Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Mar 2004
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Escaping "&" "<" ">" from DB data

    Hi,

    Anyone got a good function for filtering HTML illegal characters?

    I need an escape and unescape for entities so I can get from db and call do db using raw ascii chars, but present the data with entities.

  • #2
    Az`
    Az` is offline
    New Coder
    Join Date
    Mar 2004
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You might be looking for
    PHP Code:
    htmlspecialchars() 
    It will convert characters into their html equivalents - So > becomes &gt;

    Edit: Bit of browsing returns: http://uk.php.net/manual/en/function.htmlentities.php
    Last edited by Az`; 03-31-2004 at 05:54 PM.

  • #3
    Regular Coder
    Join Date
    Mar 2004
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    htmlentities()
    html_entity_decode() 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •