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
    Dec 2006
    Posts
    417
    Thanks
    168
    Thanked 1 Time in 1 Post

    trying to convert #039; to an apostrophe

    Hello,

    I am trying to convert this:

    Dodgers#039; Lowe keeps Bonds stuck at 751

    to this:

    Dodgers' Lowe keeps Bonds stuck at 751

    I am using:

    Code:
    html_entity_decode($headline)
    but it isn't converting #039; to '

    thanks in advance

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    urldecode()? should work possibly

  • #3
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,036
    Thanks
    2
    Thanked 316 Times in 308 Posts
    The proper html encoding of a ' is (with no space) - & #039;

    Also, if you read the manual for the html_entity_decode(...) function, you will learn that to get it to decode a single quote, you must use the second parameter and set it to ENT_QUOTES - http://php.net/html_entity_decode
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Posting Permissions

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