SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: RegEx Ne1?

  1. #1
    SitePoint Addict Shaydez's Avatar
    Join Date
    Jul 2006
    Location
    Boca Raton, Florida
    Posts
    356
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    RegEx Ne1?

    Hello..

    i suck with RegEx i'm hoping someone can help me out.

    i need to remove call special html characters begins with & and end with ;

    like &nbps; © — and those other ones or if someone knows a list of arrays i can use with str_replace.

  2. #2
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    SitePoint Addict Shaydez's Avatar
    Join Date
    Jul 2006
    Location
    Boca Raton, Florida
    Posts
    356
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    lol i guess i should've mentioned it in the first post.

    no html_entitles / specialcharacters functions are not going to work. it needs to be removed. I'm working with Google Shopping and special characters can't be in the product description for example those trademark or copyright signs. The results are going into a XML RSS 2.0 feed.

    so it needs to be removed, not decoded or converted.

  4. #4
    hi galen's Avatar
    Join Date
    Jan 2006
    Location
    New Haven, CT
    Posts
    1,228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this should work

    PHP Code:
    preg_replace('~&\S+;~'''$str); 


Bookmarks

Posting Permissions

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