codehaven - php snippets - coding help
Generic filters
Exact matches only
  • Get character count of a string saved in database – html_entity_decode not working

    23rd September 2022

    Php - Strings

    php codehaven

    As you can see the saved string has html code within, and when the html_entity_decode is performed upon the string this is being included within the character count.

    With a slight adjustment to the code by adding – ENT_QUOTES,”UTF-8″ we get the correct amount of characters within the string as seem by a webpage after decode.

    charactercount

    Was this code snippet helpful?